Boost logo

Boost :

Subject: Re: [boost] [config] What Feature is this??
From: Peter Dimov (lists_at_[hidden])
Date: 2017-07-24 15:30:40


Alain Miniussi wrote:

> The name mangling of the gnu ABI (used by most unix-like) does not encode
> the return type, and the result does not have to be used when the function
> is called.
>
> So if such a functionality is added, the mangling issue alone will hurt
> backward compatibility real bad.

Template parameters are encoded though, so when faced with compiler
protestations that two function templates are the same, I just start adding
dummy class = void parameters to differentiate.

That is,

template<class... A> auto f(A&&... a) -> decltype(expr1);
template<class... A> auto f(A&&... a) -> decltype(expr2);

becomes

template<class... A> auto f(A&&... a) -> decltype(expr1);
template<class... A, class = void> auto f(A&&... a) -> decltype(expr2);


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