Quantcast
Channel: C++14 Variable Templates: what is their purpose? Any usage example? - Stack Overflow
Viewing all articles
Browse latest Browse all 7

Answer by n. m. could be an AI for C++14 Variable Templates: what is their purpose? Any usage example?

$
0
0

we can have this feature just by wrapping a variable within a templated struct or class

Yes, but that would be gratuitous syntactic salt. Not healthy for the blood pressure.

pi<double> conveys the intent better than pi<double>::value. Short and to the point. That's enough of a reason in my book to allow and encourage this syntax.


Viewing all articles
Browse latest Browse all 7

Trending Articles



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