Boost logo

Boost :

Subject: Re: [boost] the Boost policy for protecting against "too perfect forwarding"
From: Nevin Liber (nevin_at_[hidden])
Date: 2014-04-25 11:34:30


On 25 April 2014 09:48, Andrzej Krzemienski <akrzemi1_at_[hidden]> wrote:

> There are two ways for protecting against it:
> 1. enable_if -- to disable the unwanted overloads
> 2. Add additional constructor overloads.
>

3. Pass by value
4. Use a tag for the first parameter in the constructor

(There are probably more...)

(1) appears cleaner, but some compilers might not support SFINAE.
>

AFAIK, the set of compilers that support C++11 but do not support SFINAE is
empty.
 --
 Nevin ":-)" Liber <mailto:nevin_at_[hidden]> (847) 691-1404


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