Boost logo

Boost Users :

Subject: Re: [Boost-users] [mpl] How to use not_ with has_trivial_destructor metafunction
From: Christian Henning (chhenning_at_[hidden])
Date: 2012-11-22 14:18:19


Hi Nathan,

On Wed, Nov 21, 2012 at 8:15 PM, Nathan Crookston
<nathan.crookston_at_[hidden]> wrote:
> Hi Christian,
>
>
> Christian Henning wrote:
>>
>> The error I'm getting is:
>>
>> error C2770: invalid explicit template argument(s) for 'void
>>
>> foo(boost::enable_if<boost::mpl::not_<boost::has_trivial_destructor<T>>>::type
>> *)'
>>
>> Can someone see what the problem might be?
>
>
> Actually, it looks like the code's working -- you're SFINAEing out foo for
> types that have a trivial destructor -- which includes int. It works the
> same in g++4.5 and VC10.
>
> Removing the not wrapper allows the code to compile on both -- as it should.
>
> Try passing a type with a non-trivial destructor (e.g., std::string) to
> allow this use to compile.

Yes, of course, you're correct. Sorry for the noise. What I need to
provide is foo function for types that do have a trivial destructor.

Happy Turkey Day,
Christian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net