Boost logo

Boost :

Subject: Re: [boost] [review][mp11] Formal review of Mp11
From: Peter Dimov (lists_at_[hidden])
Date: 2017-07-15 13:11:57

Andrey Semashev wrote:

> > The idea here is that mp_if_c can be used in two ways. One is
> > mp_if_c<Cond, T, E>, which gives either T or E depending on Cond. The
> > other is mp_if_c<Cond, T>, which is the same as std::enable_if_t<Cond,
> > T> - gives T when Cond, otherwise a substitution failure.

> Why not separate the two use case into two primitives? We usually want one
> or the other and different tools would make sense, at least for
> documenting purpose.

One could go either way on that, I suppose. It makes sense because mp_if<C,
T, E> gives you T when C, otherwise E, and mp_if<C, T> gives you T when C,
otherwise <nothing>. "If C, T, otherwise, ..."

Boost list run by bdawes at, gregod at, cpdaniel at, john at