Skip to content

Commit

Permalink
MSVC fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TartanLlama committed Jan 21, 2025
1 parent 5ec21f2 commit db7add9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions include/tl/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

#if !defined(TL_ASSERT)
//can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
#if (__cplusplus > 201103L) && !defined(TL_EXPECTED_GCC49)
#if (TL_CPLUSPLUS > 201103L) && !defined(TL_EXPECTED_GCC49)
#include <cassert>
#define TL_ASSERT(x) assert(x)
#else
Expand Down Expand Up @@ -109,7 +109,13 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
std::is_trivially_destructible<T>
#endif

#if __cplusplus > 201103L || (defined(_MSC_VER) && _MSC_VER >= 1910)
#ifdef _MSVC_LANG
#define TL_CPLUSPLUS _MSVC_LANG
#else
#define TL_CPLUSPLUS __cplusplus
#endif

#if TL_CPLUSPLUS > 201103L
#define TL_EXPECTED_CXX14
#endif

Expand All @@ -119,7 +125,7 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
#define TL_EXPECTED_GCC49_CONSTEXPR constexpr
#endif

#if (__cplusplus == 201103L || defined(TL_EXPECTED_MSVC2015) || \
#if (TL_CPLUSPLUS == 201103L || defined(TL_EXPECTED_MSVC2015) || \
defined(TL_EXPECTED_GCC49))
#define TL_EXPECTED_11_CONSTEXPR
#else
Expand Down

0 comments on commit db7add9

Please sign in to comment.