Avoid msvc-14.0 constexpr errors in enum_to_string

This commit is contained in:
Peter Dimov
2025-12-15 19:39:46 +02:00
parent a722380b2a
commit 4959611e09
2 changed files with 9 additions and 3 deletions

View File

@@ -42,7 +42,10 @@ template<class E> struct ets_lambda
} // namespace detail
template<class E, class De = describe_enumerators<E>>
constexpr char const* enum_to_string( E e, char const* def ) noexcept
#if !( defined(_MSC_VER) && _MSC_VER == 1900 )
constexpr
#endif
char const* enum_to_string( E e, char const* def ) noexcept
{
char const* r = def;

View File

@@ -5,13 +5,16 @@
#include <boost/describe/enum_to_string.hpp>
#include <boost/describe/enum.hpp>
#include <boost/describe/detail/cx_streq.hpp>
#include <boost/config/pragma_message.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
#elif defined(_MSC_VER) && _MSC_VER == 1900
BOOST_PRAGMA_MESSAGE("Skipping test because _MSC_VER == 1900")
#else
#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)