Boost logo

Boost :

Subject: Re: [boost] [concept] forward declarations and `BOOST_CONCEPT_REQUIRES()`
From: Stefan van Kessel (van_kessel_at_[hidden])
Date: 2010-08-10 17:01:42


On 8/10/2010 10:05 PM, Lorenzo Caminiti wrote:
> On Mon, Aug 9, 2010 at 10:00 PM, Dave Abrahams<dave_at_[hidden]> wrote:
>> Just from looking at the error message this would seem to be a
>> cut-and-dried case of bugs in the compiler. The "overloads" it is
>> saying are ambiguous are identical, meaning they're really just one
>> thing.
>
> Yes, I noticed the same thing. I cannot try the code on other
> compilers at the moment, it would be great if anyone from this mailing
> list could do that and let me know...
>
> Even assuming this is a MSVC bug, is there a workaround for it?
>

For what it's worth. On MSVC10 your code only fails to build in Debug
mode for me. There's a Workaround already in requires.hpp that only
triggers if BOOST_MSVC < 1300 or #ifdef(NDEBUG). Adding ||
BOOST_WORKAROUND(BOOST_MSVC, == 1600) (obviously 1600 is my _MSC_VER)
gets rid of the problem for me. I don't know why the workaround has been
disabled for debug builds and I don't know if enabling it that way
wreaks havoc somewhere else.

Have a nice day,
Stefan

#if defined(NDEBUG) || BOOST_WORKAROUND(BOOST_MSVC, < 1300) ||
BOOST_WORKAROUND(BOOST_MSVC, == 1600)

# define BOOST_CONCEPT_REQUIRES(models, result)
            \
     typename
::boost::parameter::aux::unaryfunptr_arg_type<void(*)result>::type


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