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

Answer by HolyBlackCat for How to create type T and value of type T template with default type T?

$
0
0

It's impossible to support this exact syntax (all 4 forms at the same time).

The closest thing I can think of is:

template <auto V = 0>struct Example {};
Example<int(1)> a; // Type and value.Example<int{}> a;  // Type only.Example a;         // Neither.Example<1> a;      // Value only.

Viewing all articles
Browse latest Browse all 1313

Trending Articles



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