Commit 4458a050 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

add traits for testing whether something is a template or a type and add enable_if_all

parent e01dcaf2
......@@ -97,4 +97,29 @@ namespace AMDiS
return std::make_unique<TYPEOF(obj)>(FWD(obj));
}
template <template <class...> class>
constexpr bool is_template() { return true; }
#if AMDIS_HAS_CXX_AUTO_TEMPLATE_PARAMETER
template <template <class,auto...> class>
constexpr bool is_template() { return true; }
#else
template <template <class,int...> class>
constexpr bool is_template() { return true; }
template <template <class,std::size_t...> class>
constexpr bool is_template() { return true; }
#endif
template <class>
constexpr bool is_template() { return false; }
template <bool... b>
using enable_if_all_t
= std::enable_if_t<std::is_same<std::integer_sequence<bool,true,b...>,
std::integer_sequence<bool,b...,true>>::value>;
} // end namespace AMDiS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment