template <class T>
struct Test {
T workingOnlyWithIntegerOrDouble();
private:
T num_;
}
template <class T>
struct is_permitted
{
static constexpr bool value = false;
};
template <>
struct is_permitted<int>
{
static constexpr bool value = true;
};
template <>
struct is_permitted<double>
{
static constexpr bool value = true;
};
template <class T>
struct test
{
test()
{
static_assert(is_permitted<T>::value);
}
};