@@ -1142,6 +1142,13 @@ struct RootNodeCopyHelper
1142
1142
template <typename RootT, typename OtherRootT>
1143
1143
struct RootNodeCopyHelper <RootT, OtherRootT, /* Compatible=*/ true >
1144
1144
{
1145
+ // / @todo Consider using a value conversion functor passed as an argument instead.
1146
+ template <typename ValueT, typename OtherValueT>
1147
+ static inline ValueT convertValue (const OtherValueT &val)
1148
+ {
1149
+ return ValueT (val);
1150
+ }
1151
+
1145
1152
static inline void copyWithValueConversion (RootT& self, const OtherRootT& other)
1146
1153
{
1147
1154
using ValueT = typename RootT::ValueType;
@@ -1152,12 +1159,7 @@ struct RootNodeCopyHelper<RootT, OtherRootT, /*Compatible=*/true>
1152
1159
using OtherMapCIter = typename OtherRootT::MapCIter;
1153
1160
using OtherTile = typename OtherRootT::Tile;
1154
1161
1155
- struct Local {
1156
- // / @todo Consider using a value conversion functor passed as an argument instead.
1157
- static inline ValueT convertValue (const OtherValueT& val) { return ValueT (val); }
1158
- };
1159
-
1160
- self.mBackground = Local::convertValue (other.mBackground );
1162
+ self.mBackground = convertValue<ValueT, OtherValueT>(other.mBackground );
1161
1163
#if OPENVDB_ABI_VERSION_NUMBER >= 10
1162
1164
if (other.mOrigin != Coord (0 ,0 ,0 )) {
1163
1165
OPENVDB_THROW (ValueError, " RootNodeCopyHelper::copyWithValueConversion: non-zero offsets are currently not supported" );
@@ -1174,7 +1176,7 @@ struct RootNodeCopyHelper<RootT, OtherRootT, /*Compatible=*/true>
1174
1176
// Copy the other node's tile, but convert its value to this node's ValueType.
1175
1177
const OtherTile& otherTile = other.getTile (i);
1176
1178
self.mTable [i->first ] = NodeStruct (
1177
- Tile (Local:: convertValue (otherTile.value ), otherTile.active ));
1179
+ Tile (convertValue<ValueT, OtherValueT> (otherTile.value ), otherTile.active ));
1178
1180
} else {
1179
1181
// Copy the other node's child, but convert its values to this node's ValueType.
1180
1182
self.mTable [i->first ] = NodeStruct (*(new ChildT (other.getChild (i))));
0 commit comments