
14 Jun
2009
14 Jun
'09
7:20 p.m.
joel wrote:
Is there any deep explanation on how the concept_check class from Boost:/Concept works ?
I'm trying to see how to turn a concept into a traits but all my attempt are failing miserably and I think that's because I don't get how the concept check work in itself.
Concept_check simply instantiates a function named "requires" but never calls it. If the function body contains expressions not supported by the types concerned then C++ will generate an error by itself. To adapt that into a trait, you need support for SFINAE for expressions. Such is available in both C++03 and C++0x in GCC since version 4.4, for example.