Re: [Boost-bugs] [Boost C++ Libraries] #11602: boost.variant constructor accepts any type as parameter

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11602: boost.variant constructor accepts any type as parameter
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-01 08:31:17


#11602: boost.variant constructor accepts any type as parameter
-------------------------------+---------------------
  Reporter: piotrwn1@… | Owner: ebf
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: variant
   Version: Boost 1.58.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by piotrwn1@…):

 Maybe better would to use IsConvertibleToAnyOf instead of IsAnyOf:


 {{{
 template <typename T, typename ...C>
 struct IsConvertibleToAnyOf;

 template <typename T>
 struct IsConvertibleToAnyOf<T> : std::false_type {};


 template <typename T, typename C1, typename ...C>
 struct IsConvertibleToAnyOf<T,C1,C...> : std::integral_constant<bool,
     std::is_convertible<T,C1>::value or
     IsConvertibleToAnyOf<T,C...>::value> {};
 }}}

 BR,

 Piotr Nycz

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11602#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC