Good point. Determining whether you can mark functions as constexpr seems like a reasonable motivation for at least try/catch and changing the active union member. Probably also for virtual function calls. How many feature test macros do we want? (Clang already implemented all of these, so we'll start advertising them all in the same release and don't need separate macros; I don't know about other implementations.)
In this case, would having granular macros help? I guess we'd write:
#if __cpp_constexpr_union_assign
constexpr
#endif
optional& operator=(nullopt_t) noexcept;
and is going to be more user friendly than
#if __cpp_constexpr > whatwasthatnumberagain
constexpr
#endif
and both probably easier to understand than
#if __cpp_constexpr > whatever
#define CONSTEXPR_UNION_TRY_POLY constexpr
#else
#define CONSTEXPR_UNION_TRY_POLY
#endif
CONSTEXPR_UNION_TRY_POLY optional& operator=(nullopt_t) noexcept;
although there's probably some clever preprocessor way of writing
CONSTEXPR(thatvalue) optional& operator=(nullopt_t) noexcept;
which wouldn't be so bad?
Barry