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

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 1262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>