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

Why does `std::integral_constant` have a `::type` that refers to itself?

$
0
0

I'm reading the documentation on std::integral_constant, and apparently it includes using type that refers to itself.

template <typename T, T Value>struct integral_constant{    using type = integral_constant<T, Value>;    // ...};

What is this typedef used for?

To access it you already need to know the type, so I don't see what benefit it brings.


Viewing all articles
Browse latest Browse all 1290

Trending Articles



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