
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. Regards -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35

Hi, ----- Original Message ----- From: "joel" <joel.falcou@lri.fr> To: <boost@lists.boost.org> Sent: Sunday, June 14, 2009 6:30 PM Subject: [boost] From Concept class to type traits
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.
I don't know if what you are locking for corresponds to the ConceptTraits library (https://svn.boost.org/trac/boost/wiki/LibrariesUnderConstruction#Boost.Conce...). HTH, Vicente

I don't know if what you are locking for corresponds to the ConceptTraits library (https://svn.boost.org/trac/boost/wiki/LibrariesUnderConstruction#Boost.Conce...). I'm torn between happyness and this sloppy feeling of almost reinventing
vicente.botet wrote: the wheel. Thanks for the pointer :) Will save me lotsa time -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35

vicente.botet wrote:
I don't know if what you are locking for corresponds to the ConceptTraits library (https://svn.boost.org/trac/boost/wiki/LibrariesUnderConstruction#Boost.Conce...).
I haven't seen updates for that library for quite some time. Why wasn't this ever proposed to complement or supplement concept_check?

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.

on Sun Jun 14 2009, joel <joel.falcou-AT-lri.fr> wrote:
Is there any deep explanation on how the concept_check class from Boost:/Concept works ?
What concept_check class? I don't think any class or even a template with that name exists in Boost.
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 checks are intentionally constructed to produce compilation errors when violated, so they're really unsuitable for answering yes/no type questions as people usually want traits to do. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
participants (5)
-
David Abrahams
-
joel
-
Joel Falcou
-
Mathias Gaunard
-
vicente.botet