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 16:54:21


On 8/11/2010 8:44 PM, Lorenzo Caminiti wrote:
> I have this error on _MSC_VER 1400 (MSVC8?) so I was thinking to use:
>
> #if BOOST_WORKAROUND(BOOST_MSVC,>= 1400)
> ... // Workaround wrapper for BOOST_CONCEPT_CHECK following your code below.
> #else
> ... // Original BOOST_CONCEPT_CHECK with no workaround.
> #endif

That is the general idea but I'd go with
#elif BOOST_WORKAROUND(BOOST_MSVC, <= 1600) &&
BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
since I'm still hopeful that in the upcoming MSVC release the workaround
won't be necessary.

>> 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)
>
> I don't have `decltype()` (I think that is a C++0x feature...). What
> shall I use instead? Boost.TypeOf somehow? Can you please sketch the
> code without `decltype()`?

Actually the decltype isn't required at all. It is just a remnant of a
previous attempt where without accessing ::boost::_requires_<>::value
the compiler didn't seem to instantiate the _requires_ template. I
should have double checked.

I do not have Visual Studio 2005 (MSVC8) installed right now but on
Visual Studio 2008 (MSVC9) it compiles when simply leaving out the
decltype and ::value.

Here is a link to a patchfile:
https://svn.boost.org/trac/boost/attachment/ticket/4526/pathfile2.patch

Have a nice day,
Stefan


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