@@ -1063,7 +1063,7 @@ struct TreeAdapter
10631063 using TreePtrType = typename TreeType::Ptr;
10641064 using ConstTreePtrType = typename TreeType::ConstPtr;
10651065 using NonConstTreePtrType = typename NonConstTreeType::Ptr;
1066- using GridType = Grid<TreeType >;
1066+ using GridType = Grid<NonConstTreeType >;
10671067 using NonConstGridType = Grid<NonConstTreeType>;
10681068 using GridPtrType = typename GridType::Ptr;
10691069 using NonConstGridPtrType = typename NonConstGridType::Ptr;
@@ -1073,14 +1073,14 @@ struct TreeAdapter
10731073 using ConstAccessorType = typename tree::ValueAccessor<const TreeType>;
10741074 using NonConstAccessorType = typename tree::ValueAccessor<NonConstTreeType>;
10751075
1076- static TreeType & tree (TreeType & t) { return t; }
1077- static TreeType & tree (GridType & g) { return g.tree (); }
1078- static const TreeType & tree (const TreeType & t) { return t; }
1079- static const TreeType & tree (const GridType & g) { return g.tree (); }
1080- static const TreeType & constTree (TreeType & t) { return t; }
1081- static const TreeType & constTree (GridType & g) { return g.constTree (); }
1082- static const TreeType & constTree (const TreeType & t) { return t; }
1083- static const TreeType & constTree (const GridType & g) { return g.constTree (); }
1076+ static NonConstTreeType & tree (NonConstTreeType & t) { return t; }
1077+ static NonConstTreeType & tree (NonConstGridType & g) { return g.tree (); }
1078+ static const NonConstTreeType & tree (const NonConstTreeType & t) { return t; }
1079+ static const NonConstTreeType & tree (const NonConstGridType & g) { return g.tree (); }
1080+ static const NonConstTreeType & constTree (NonConstTreeType & t) { return t; }
1081+ static const NonConstTreeType & constTree (NonConstGridType & g) { return g.constTree (); }
1082+ static const NonConstTreeType & constTree (const NonConstTreeType & t) { return t; }
1083+ static const NonConstTreeType & constTree (const NonConstGridType & g) { return g.constTree (); }
10841084};
10851085
10861086
@@ -1103,19 +1103,19 @@ struct TreeAdapter<Grid<_TreeType> >
11031103 using ConstAccessorType = typename tree::ValueAccessor<const TreeType>;
11041104 using NonConstAccessorType = typename tree::ValueAccessor<NonConstTreeType>;
11051105
1106- static TreeType & tree (TreeType & t) { return t; }
1107- static TreeType & tree (GridType & g) { return g.tree (); }
1108- static const TreeType & tree (const TreeType & t) { return t; }
1109- static const TreeType & tree (const GridType & g) { return g.tree (); }
1110- static const TreeType & constTree (TreeType & t) { return t; }
1111- static const TreeType & constTree (GridType & g) { return g.constTree (); }
1112- static const TreeType & constTree (const TreeType & t) { return t; }
1113- static const TreeType & constTree (const GridType & g) { return g.constTree (); }
1106+ static NonConstTreeType & tree (NonConstTreeType & t) { return t; }
1107+ static NonConstTreeType & tree (NonConstGridType & g) { return g.tree (); }
1108+ static const NonConstTreeType & tree (const NonConstTreeType & t) { return t; }
1109+ static const NonConstTreeType & tree (const NonConstGridType & g) { return g.tree (); }
1110+ static const NonConstTreeType & constTree (NonConstTreeType & t) { return t; }
1111+ static const NonConstTreeType & constTree (NonConstGridType & g) { return g.constTree (); }
1112+ static const NonConstTreeType & constTree (const NonConstTreeType & t) { return t; }
1113+ static const NonConstTreeType & constTree (const NonConstGridType & g) { return g.constTree (); }
11141114};
11151115
1116- // / Partial specialization for ValueAccessor types
1116+ // / Partial specialization for const Grid types
11171117template <typename _TreeType>
1118- struct TreeAdapter <tree::ValueAccessor <_TreeType> >
1118+ struct TreeAdapter <const Grid <_TreeType> >
11191119{
11201120 using TreeType = _TreeType;
11211121 using NonConstTreeType = typename std::remove_const<TreeType>::type;
@@ -1132,16 +1132,51 @@ struct TreeAdapter<tree::ValueAccessor<_TreeType> >
11321132 using ConstAccessorType = typename tree::ValueAccessor<const TreeType>;
11331133 using NonConstAccessorType = typename tree::ValueAccessor<NonConstTreeType>;
11341134
1135- static TreeType& tree (TreeType& t) { return t; }
1136- static TreeType& tree (GridType& g) { return g.tree (); }
1137- static TreeType& tree (AccessorType& a) { return a.tree (); }
1138- static const TreeType& tree (const TreeType& t) { return t; }
1139- static const TreeType& tree (const GridType& g) { return g.tree (); }
1140- static const TreeType& tree (const AccessorType& a) { return a.tree (); }
1141- static const TreeType& constTree (TreeType& t) { return t; }
1142- static const TreeType& constTree (GridType& g) { return g.constTree (); }
1143- static const TreeType& constTree (const TreeType& t) { return t; }
1144- static const TreeType& constTree (const GridType& g) { return g.constTree (); }
1135+ static NonConstTreeType& tree (NonConstTreeType& t) { return t; }
1136+ static NonConstTreeType& tree (NonConstGridType& g) { return g.tree (); }
1137+ static const NonConstTreeType& tree (const NonConstTreeType& t) { return t; }
1138+ static const NonConstTreeType& tree (const NonConstGridType& g) { return g.tree (); }
1139+ static const NonConstTreeType& constTree (NonConstTreeType& t) { return t; }
1140+ static const NonConstTreeType& constTree (NonConstGridType& g) { return g.constTree (); }
1141+ static const NonConstTreeType& constTree (const NonConstTreeType& t) { return t; }
1142+ static const NonConstTreeType& constTree (const NonConstGridType& g) { return g.constTree (); }
1143+ };
1144+
1145+ // / Partial specialization for ValueAccessor types
1146+ template <typename _TreeType>
1147+ struct TreeAdapter <tree::ValueAccessor<_TreeType> >
1148+ {
1149+ using TreeType = _TreeType;
1150+ using NonConstTreeType = typename std::remove_const<TreeType>::type;
1151+ using TreePtrType = typename TreeType::Ptr;
1152+ using ConstTreePtrType = typename TreeType::ConstPtr;
1153+ using NonConstTreePtrType = typename NonConstTreeType::Ptr;
1154+ using GridType = Grid<NonConstTreeType>;
1155+ using NonConstGridType = Grid<NonConstTreeType>;
1156+ using GridPtrType = typename GridType::Ptr;
1157+ using NonConstGridPtrType = typename NonConstGridType::Ptr;
1158+ using ConstGridPtrType = typename GridType::ConstPtr;
1159+ using ValueType = typename TreeType::ValueType;
1160+ using AccessorType = typename tree::ValueAccessor<TreeType>;
1161+ using ConstAccessorType = typename tree::ValueAccessor<const NonConstTreeType>;
1162+ using NonConstAccessorType = typename tree::ValueAccessor<NonConstTreeType>;
1163+
1164+ static NonConstTreeType& tree (NonConstTreeType& t) { return t; }
1165+ static NonConstTreeType& tree (NonConstGridType& g) { return g.tree (); }
1166+ static NonConstTreeType& tree (NonConstAccessorType& a) { return a.tree (); }
1167+ static const NonConstTreeType& tree (ConstAccessorType& a) { return a.tree (); }
1168+ static const NonConstTreeType& tree (const NonConstTreeType& t) { return t; }
1169+ static const NonConstTreeType& tree (const NonConstGridType& g) { return g.tree (); }
1170+ static const NonConstTreeType& tree (const NonConstAccessorType& a) { return a.tree (); }
1171+ static const NonConstTreeType& tree (const ConstAccessorType& a) { return a.tree (); }
1172+ static const NonConstTreeType& constTree (NonConstTreeType& t) { return t; }
1173+ static const NonConstTreeType& constTree (NonConstGridType& g) { return g.constTree (); }
1174+ static const NonConstTreeType& constTree (NonConstAccessorType& a) { return a.tree (); }
1175+ static const NonConstTreeType& constTree (ConstAccessorType& a) { return a.tree (); }
1176+ static const NonConstTreeType& constTree (const NonConstTreeType& t) { return t; }
1177+ static const NonConstTreeType& constTree (const NonConstGridType& g) { return g.constTree (); }
1178+ static const NonConstTreeType& constTree (const NonConstAccessorType& a) { return a.tree (); }
1179+ static const NonConstTreeType& constTree (const ConstAccessorType& a) { return a.tree (); }
11451180};
11461181
11471182// @}
0 commit comments