Boost logo

Boost :

Subject: Re: [boost] enable_if and non-template member functions?
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2011-08-06 06:45:30


On Sat, Aug 6, 2011 at 12:43 PM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
> On 08/06/2011 10:38 AM, John Maddock wrote:
>>
>> Folks, I have a problem with enable_if: it works just dandy for template
>> member functions in my class, but I have some *non-template* member
>> functions and constructors that I want to enable only if the template is
>> instantiated with template args that meet certain criteria. Seems like I
>> can't do this with enable_if as it then generates an invalid class
>> definition. I guess I could use base classes, and/or partial
>> specialization, but both involve a lot of code duplication I'd rather
>> not have. Anyone any ideas?
>
> Make a member function that forwards to a free template function?
>

Or maybe class specializations?


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