Boost logo

Boost :

Subject: Re: [boost] [concept] forward declarations and `BOOST_CONCEPT_REQUIRES()`
From: Stefan van Kessel (van_kessel_at_[hidden])
Date: 2010-08-11 02:27:58


On 8/11/2010 12:28 AM, Dave Abrahams wrote:

> Could you please make note of this in a Trac ticket? Otherwise it's
> liable to get lost.

Done. The Ticket # is 4526.

With very little testing, the following code fixes the issue for me on
MSVC10. I just tried avoiding non-type template arguments.

#elif BOOST_WORKAROUND(BOOST_MSVC, == 1600)
template <typename T1, typename T2>
struct requires_msvc10
{
        typedef typename T2::type type;
};

template <typename T>
struct relay_type_msvc10
{
        typedef T type;
};

#define BOOST_CONCEPT_STRIP_PARENS(x) x
#define BOOST_CONCEPT_TEST_SINGLE_REQUIREMENT(x)
decltype(::boost::_requires_<void(*) (x) >::value)
#define BOOST_CONCEPT_CLOSE_TEMPLATE(r, data, elem) >
#define BOOST_CONCEPT_OPEN_TEMPLATE(r, data, i, elem)
::boost::requires_msvc10< BOOST_CONCEPT_TEST_SINGLE_REQUIREMENT elem ,

#define BOOST_CONCEPT_REQUIRES(models , result) \
        typename \
        BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_OPEN_TEMPLATE, 0, models) \
                ::boost::relay_type_msvc10< BOOST_CONCEPT_STRIP_PARENS result> \
                BOOST_PP_SEQ_FOR_EACH(BOOST_CONCEPT_CLOSE_TEMPLATE, 0, models) \
                ::type


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