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

Answer by HolyBlackCat for Why can't C++ concepts use a simple requirement to check if a nested type exists?

$
0
0

I know concept HasInner = requires { typename T::inner; }; is ok. But I want know why the first one is not ok.

Because requires{ T::inner; } expects T::inner to not be a type (but rather a variable or a function). I'm not sure what answer you expected.

It wouldn't be very useful to make T::inner accept both types and non-types.


Viewing all articles
Browse latest Browse all 946

Trending Articles



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