Boost logo

Boost :

Subject: Re: [boost] Boost.Generic, C++0x Concepts, and C++1y Concepts
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2012-09-27 17:12:09


On Thu, Sep 27, 2012 at 5:09 PM, Matt Calabrese <rivorus_at_[hidden]> wrote:

> On Thu, Sep 27, 2012 at 4:00 PM, Lorenzo Caminiti <lorcaminiti_at_[hidden]>wrote:
>
>> I'd probably be more interested in the part of the impl that expands
>> the macro code to implement concepts, not necessarily the pp stuff.
>>
>
> Refer to boost/generic/concept.hpp line 253
> BOOST_GENERIC_CONCEPT_IMPL_VALID_
>
> It's probably hard to decipher since, as you probably realize, pretty much
> everything needs to go into its own, separate metafunction and everything
> needs to be expanded inside of template specialization argument lists in
> order for SFINAE to take place, and all of the associated types of the
> concept need to be template arguments to every single one of those
> metafunctions for SFINAE to work with them as well. Also, on the macro
> side, in order to reduce compile times, I avoid making multiple passes over
> the top-level macro arguments and instead preprocess it all at once,
> putting code that will eventually go into different locations into
> different boost preprocessor sequence elements, and then I pull those out
> individually at the end. This succeeded at greatly reducing compile-times,
> but it makes the code harder to read.
>

Also, if you want to simply see the preprocessor output, refer to the
"*.hei" files in the include directories. These are the pre-preprocessed
forms of the standard concepts, individually.

-- 
-Matt Calabrese

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk