Skip to content

Commit

Permalink
fix value_traits to be able to match T, T& and T const& to the direct…
Browse files Browse the repository at this point in the history
… type stored in variant (ref #112)
  • Loading branch information
artemp committed Jul 18, 2016
1 parent b5728ad commit b3a002d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/mapbox/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct convertible_type<T>
template <typename T, typename... Types>
struct value_traits
{
using value_type = typename std::remove_reference<T>::type;
using value_type = typename std::remove_const<typename std::remove_reference<T>::type>::type;
static constexpr std::size_t direct_index = direct_type<value_type, Types...>::index;
static constexpr bool is_direct = direct_index != invalid_value;
static constexpr std::size_t index = is_direct ? direct_index : convertible_type<value_type, Types...>::index;
Expand Down

0 comments on commit b3a002d

Please sign in to comment.