Skip to content

Commit 776b6fd

Browse files
committed
changed convert function to template to avoid undefined alias with clang-cl. Resolves #1785
Signed-off-by: bgottamd <[email protected]>
1 parent 45d2ce4 commit 776b6fd

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Diff for: openvdb/openvdb/tree/RootNode.h

+9-7
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,13 @@ struct RootNodeCopyHelper
11421142
template<typename RootT, typename OtherRootT>
11431143
struct RootNodeCopyHelper<RootT, OtherRootT, /*Compatible=*/true>
11441144
{
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+
11451152
static inline void copyWithValueConversion(RootT& self, const OtherRootT& other)
11461153
{
11471154
using ValueT = typename RootT::ValueType;
@@ -1152,12 +1159,7 @@ struct RootNodeCopyHelper<RootT, OtherRootT, /*Compatible=*/true>
11521159
using OtherMapCIter = typename OtherRootT::MapCIter;
11531160
using OtherTile = typename OtherRootT::Tile;
11541161

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);
11611163
#if OPENVDB_ABI_VERSION_NUMBER >= 10
11621164
if (other.mOrigin != Coord(0,0,0)) {
11631165
OPENVDB_THROW(ValueError, "RootNodeCopyHelper::copyWithValueConversion: non-zero offsets are currently not supported");
@@ -1174,7 +1176,7 @@ struct RootNodeCopyHelper<RootT, OtherRootT, /*Compatible=*/true>
11741176
// Copy the other node's tile, but convert its value to this node's ValueType.
11751177
const OtherTile& otherTile = other.getTile(i);
11761178
self.mTable[i->first] = NodeStruct(
1177-
Tile(Local::convertValue(otherTile.value), otherTile.active));
1179+
Tile(convertValue<ValueT, OtherValueT>(otherTile.value), otherTile.active));
11781180
} else {
11791181
// Copy the other node's child, but convert its values to this node's ValueType.
11801182
self.mTable[i->first] = NodeStruct(*(new ChildT(other.getChild(i))));

0 commit comments

Comments
 (0)