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

Answer by HolyBlackCat for How to access template parameters?

$
0
0

The only other option is a template with a specialization to extract the argument:

template <typename T> struct GetSize {};template <std::size_t N> struct GetSize<ExtendableIndex<N>> : std::integral_constant<std::size_t, N> {};

GetSize<ExtendableIndex<42>>::value == 42

Since this is more verbose, usually your approach is used.


Viewing all articles
Browse latest Browse all 1281

Trending Articles



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