C++14 will allow variable templates:
template <typename T> constexpr T pi = T(3.1415926535897932385);
Now consider the following case:
template <typename T = double> constexpr T pi = T(3.1415926535897932385);
Question: how do I get pi
with the default parameter ?
pi; // Option 1 (I hope...)
pi<>; // Option 2
Based on n3651 I would say pi<>;
. In the current standard template argument deduction, which being able to do pi
is a form of, only applies to functions. Since the paper mentions absolutely nothing about TAD it is unlikely they would use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With