mapbox / variant

C++11/C++14 Variant
BSD 3-Clause "New" or "Revised" License
371 stars 100 forks source link

add intial `variant_alternative` implementation (#161 http://en.cppre… #162

Closed artemp closed 7 years ago

artemp commented 7 years ago

…ference.com/w/cpp/utility/variant/variant_alternative)

daniel-j-h commented 7 years ago

Also if we want to be C++17 compatible'ish we need other functionality (like variant_size), too, no?

http://en.cppreference.com/w/cpp/utility/variant

artemp commented 7 years ago

@daniel-j-h - thanks, I'll take a look and update tomorrow.

artemp commented 7 years ago

@daniel-j-h

re: variant_size - yep, good call I'll work on a separate PR. General strategy is to add new features when user(s) ask for it, but variant_size compliment variant_alternative somewhat so we should add it I think.

artemp commented 7 years ago

Note to myself : consider using built-in __type_pack_element when available (e.g clang)

artemp commented 7 years ago

835ebc19321c6a9696a2072b7fbd5ca3de818860 adds variant_size support as a part of this PR.

NOTE: variant_size_v is commented out as we're sticking to c++11 for the time being.