
28 Jun
2014
28 Jun
'14
9:34 p.m.
On Sun, Jun 29, 2014 at 12:58 AM, Andrzej Krzemienski <akrzemi1@gmail.com> wrote:
Hi, This is the second time that I have found the following function useful when playing with variants of Optional library:
template <typename T, typename U> typename std::enable_if<std::is_convertible<U, T>::value, T>::type convert(U && u) { return std::forward<U>(u); }
It performs an implicit conversion from U to T, but you can call it explicitly.
Isn't it what implicit_cast does? See boost/implicit_cast.hpp.