Skip to content

Commit

Permalink
"Fix issue TartanLlama#126"
Browse files Browse the repository at this point in the history
Signed-off-by: Pranjali Puranik <[email protected]>
  • Loading branch information
Pranjali Puranik committed Dec 19, 2022
1 parent b74fecd commit a46fe74
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions include/tl/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,12 @@ struct is_nothrow_swappable
: std::integral_constant<
bool,
is_swappable<T, U>::value &&
((decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value &&
detail::swap_adl_tests::is_std_swap_noexcept<T>::value) ||
((decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value
&&detail::swap_adl_tests::is_std_swap_noexcept<T>::value) ||
(!decltype(detail::swap_adl_tests::uses_std<T, U>(0))::value &&
detail::swap_adl_tests::is_adl_swap_noexcept<T, U>::value))> {};
detail::swap_adl_tests::is_adl_swap_noexcept<T,
U>::value))> {
};
#endif
#endif

Expand Down Expand Up @@ -511,7 +513,6 @@ template <class T, class E> struct expected_storage_base<T, E, true, true> {
Args &&...args)
: m_unexpect(il, std::forward<Args>(args)...), m_has_val(false) {}

~expected_storage_base() = default;
union {
T m_val;
unexpected<E> m_unexpect;
Expand Down Expand Up @@ -612,13 +613,13 @@ template <class T, class E> struct expected_storage_base<T, E, false, true> {

// `T` is `void`, `E` is trivially-destructible
template <class E> struct expected_storage_base<void, E, false, true> {
#if __GNUC__ <= 5
//no constexpr for GCC 4/5 bug
#else
#if __GNUC__ <= 5
// no constexpr for GCC 4/5 bug
#else
TL_EXPECTED_MSVC2015_CONSTEXPR
#endif
#endif
expected_storage_base() : m_has_val(true) {}

constexpr expected_storage_base(no_init_t) : m_val(), m_has_val(false) {}

constexpr expected_storage_base(in_place_t) : m_has_val(true) {}
Expand Down

0 comments on commit a46fe74

Please sign in to comment.