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:
> ... // 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
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;
>> };
>> 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:

Have a nice day,

Boost list run by bdawes at, gregod at, cpdaniel at, john at