Skip to content

Commit

Permalink
Tune NCVariant.hh fix so it still works with gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed May 16, 2024
1 parent d1d2963 commit 15c2618
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ncrystal_core/include/NCrystal/NCVariant.hh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ namespace NCRYSTAL_NAMESPACE {
//Todo: some of the methods below could be noexcept depending on methods of T1 and T2
public:

//conditionally enable default constructor if ALLOW_EMPTY is Yes:
template<typename = typename std::enable_if_t<ALLOW_EMPTY==VariantAllowEmpty::Yes>>
//Conditionally enable default constructor only if ALLOW_EMPTY is Yes. This
//is done using std::enable_if SFINAE magic, which requires a dummy
//dependent method template variable U:
template<VariantAllowEmpty U = ALLOW_EMPTY, typename = typename std::enable_if<(U==VariantAllowEmpty::Yes)>::type >
constexpr Variant() noexcept {}


//NB: If ALLOW_EMPTY
Variant( const T1& );
Variant( T1&& );
Expand Down

0 comments on commit 15c2618

Please sign in to comment.