type_traits.is_specialized - MichaelMiller-/sec21 GitHub Wiki

sec21::type_traits::is_specialized

#include <sec21/type_traits/is_specialized.h>

Checks if a specialisation of a template class is available.

Example

namespace ns
{
   template <typename T>
   struct foo;

   template <>
   struct foo<int> {};

   template <>
   struct foo<std::string> {};
}

static_assert(is_specialized_v<ns::foo, int>);
static_assert(is_specialized_v<ns::foo, double> == false);
static_assert(is_specialized_v<ns::foo, float> == false);
static_assert(is_specialized_v<ns::foo, std::string> == true);
static_assert(is_specialized_v<ns::foo, std::wstring> == false);
⚠️ **GitHub.com Fallback** ⚠️