Skip to content

Commit

Permalink
add compile index in range check for __type_pack_element branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp committed Oct 20, 2017
1 parent ae19314 commit 8b1de31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/mapbox/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ struct variant_alternative;
template <std::size_t Index, typename ...Types>
struct variant_alternative<Index, variant<Types...>>
{
static_assert(sizeof...(Types) > Index , "Index out of range");
using type = __type_pack_element<Index, Types...>;
};
#endif
Expand Down

0 comments on commit 8b1de31

Please sign in to comment.