diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1c2082b..788c4fe 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -95,7 +95,6 @@ jobs: install: apt install -y clang-10 - cxx: clang++-11 install: apt install -y clang-11 - - cxx: clang++-6.0 std: 17 diff --git a/include/tl/expected.hpp b/include/tl/expected.hpp index 876e594..a2c58f0 100644 --- a/include/tl/expected.hpp +++ b/include/tl/expected.hpp @@ -132,8 +132,14 @@ struct is_trivially_copy_constructible> : std::false_type {}; #define TL_EXPECTED_11_CONSTEXPR constexpr #endif +#if TL_CPLUSPLUS >= 201703L +#define TL_EXPECTED_NODISCARD [[nodiscard]] +#else +#define TL_EXPECTED_NODISCARD +#endif + namespace tl { -template class [[nodiscard]] expected; +template class TL_EXPECTED_NODISCARD expected; #ifndef TL_MONOSTATE_INPLACE_MUTEX #define TL_MONOSTATE_INPLACE_MUTEX @@ -1276,7 +1282,7 @@ private: /// has been destroyed. The initialization state of the contained object is /// tracked by the expected object. template -class [[nodiscard]] expected : +class TL_EXPECTED_NODISCARD expected : private detail::expected_move_assign_base, private detail::expected_delete_ctor_base, private detail::expected_delete_assign_base,