File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ class SparseStencilMatrix
245245 class ConstRow ;
246246 class RowEditor ;
247247
248- static const ValueType sZeroValue ;
248+ static inline constexpr ValueType sZeroValue = zeroVal<ValueType>() ;
249249
250250 // / Construct an @a n x @a n matrix with at most @a STENCIL_SIZE nonzero elements per row.
251251 SparseStencilMatrix (SizeType n);
@@ -814,10 +814,6 @@ Vector<T>::str() const
814814// //////////////////////////////////////
815815
816816
817- template <typename ValueType, SizeType STENCIL_SIZE>
818- const ValueType SparseStencilMatrix<ValueType, STENCIL_SIZE>::sZeroValue = zeroVal<ValueType>();
819-
820-
821817template <typename ValueType, SizeType STENCIL_SIZE>
822818inline
823819SparseStencilMatrix<ValueType, STENCIL_SIZE>::SparseStencilMatrix(SizeType numRows)
Original file line number Diff line number Diff line change @@ -67,11 +67,11 @@ namespace OPENVDB_VERSION_NAME {
6767// / @note A zeroVal<T>() specialization must be defined for each @c ValueType T
6868// / that cannot be constructed using the form @c T(0). For example, @c std::string(0)
6969// / treats 0 as @c nullptr and throws a @c std::logic_error.
70- template <typename T> inline T zeroVal () { return T (0 ); }
70+ template <typename T> inline constexpr T zeroVal () { return T (0 ); }
7171// / Return the @c std::string value that corresponds to zero.
7272template <> inline std::string zeroVal<std::string>() { return " " ; }
7373// / Return the @c bool value that corresponds to zero.
74- template <> inline bool zeroVal<bool >() { return false ; }
74+ template <> inline constexpr bool zeroVal<bool >() { return false ; }
7575
7676namespace math {
7777
You can’t perform that action at this time.
0 commit comments