diff --git a/libsrc/core/utils.hpp b/libsrc/core/utils.hpp index f6df8c9e..84d1dade 100644 --- a/libsrc/core/utils.hpp +++ b/libsrc/core/utils.hpp @@ -134,21 +134,18 @@ namespace ngcore private: template static constexpr auto check(T2* t) -> typename T2::index_type { return *t; } - // this function is needed for visual because it seems to not lazy evaluate template arguments... - template - static constexpr auto check(T2* t) -> typename std::enable_if_t> {} - static constexpr auto check(...) -> decltype(std::declval().Size()) - { return decltype(std::declval().Size())(); } + static constexpr size_t check(...); + public: using type = decltype(check((T*) nullptr)); // NOLINT }; } // namespace detail - // Get index type of object. If object has a typedef index_type this type is returned - // else decltype(obj.Size()) is returned. + // Get index type of object. If object has a typedef index_type it is this type, else size_t template using index_type = typename detail::IndexTypeHelper::type; + } // namespace ngcore #endif // NETGEN_CORE_UTILS_HPP