Skip to content

Commit

Permalink
Merge branch 'master' into 111-which-constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp committed Jun 1, 2016
2 parents 74ce146 + 48d6044 commit dca3d96
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions include/mapbox/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,35 +127,6 @@ struct value_traits
using target_type = typename std::tuple_element<tindex, std::tuple<void, Types...>>::type;
};

// check if T is in Types...
template <typename T, typename... Types>
struct has_type;

template <typename T, typename First, typename... Types>
struct has_type<T, First, Types...>
{
static constexpr bool value = std::is_same<T, First>::value || has_type<T, Types...>::value;
};

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

template <typename T, typename... Types>
struct is_valid_type;

template <typename T, typename First, typename... Types>
struct is_valid_type<T, First, Types...>
{
static constexpr bool value = std::is_convertible<T, First>::value || is_valid_type<T, Types...>::value;
};

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

template <typename T, typename R = void>
struct enable_if_type
{
Expand Down

0 comments on commit dca3d96

Please sign in to comment.