|
Boost : |
Subject: Re: [boost] detecting a constructor with a specific signature
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-01-27 12:59:43
----- Original Message -----
From: "Steven Watanabe" <watanabesj_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, January 27, 2010 6:32 PM
Subject: Re: [boost] detecting a constructor with a specific signature
>
> AMDG
>
> vicente.botet wrote:
>> "Kenny Riddile" <kfriddile_at_[hidden]> wrote:
>>
>>> Alas, I'm using VC9. The first declaration of select() gives me the
>>> following error:
>>>
>>> error C2564: 'T' : a function-style conversion to a built-in type can
>>> only take one argument
>>>
>>
>> Hi,
>>
>> have you tried to double ()
>>
>> template< typename T >
>> typename result< sizeof T(( make< const std::string& >(), make< Foo& >() )) >::type select( int );
>>
>
> That doesn't try the same constructor.
>
> The problem is that this method requires extended SFINAE
> which VC9 doesn't support.
You are right, my proposal test if there is a constructor with an argument Foo&, isn't it?
I confirm it works for gcc-4.4.0 and fails to compile for gcc-4.3.2 and MSVC v9.
Steven, does this mean that it is possible to implement the trait with a good C++98 compiler? Or there are other things missing yet?
Thanks,
Vicente
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk