Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1282

Answer by HolyBlackCat for Specialize template class for some types

$
0
0

In C++20 you can use requires as following. (For earlier language versions, use std::enable_if as explained in the other ansert.)

template <typename T> class A {};template <typename T> requires std::is_fundamental_v<T>class A<T> {};

Viewing all articles
Browse latest Browse all 1282

Trending Articles