1414
1515#include " ../core/xlayout.hpp"
1616
17- #ifndef _MSC_VER
18- #if __cplusplus < 201103
19- #define CONSTEXPR11_TN
20- #define CONSTEXPR14_TN
21- #define NOEXCEPT_TN
22- #elif __cplusplus < 201402
23- #define CONSTEXPR11_TN constexpr
24- #define CONSTEXPR14_TN
25- #define NOEXCEPT_TN noexcept
26- #else
27- #define CONSTEXPR11_TN constexpr
28- #define CONSTEXPR14_TN constexpr
29- #define NOEXCEPT_TN noexcept
30- #endif
31- #else // _MSC_VER
32- #if _MSC_VER < 1900
33- #define CONSTEXPR11_TN
34- #define CONSTEXPR14_TN
35- #define NOEXCEPT_TN
36- #elif _MSC_VER < 2000
37- #define CONSTEXPR11_TN constexpr
38- #define CONSTEXPR14_TN
39- #define NOEXCEPT_TN noexcept
40- #else
41- #define CONSTEXPR11_TN constexpr
42- #define CONSTEXPR14_TN constexpr
43- #define NOEXCEPT_TN noexcept
44- #endif
45- #endif
46-
4717namespace xt
4818{
4919 // see http://stackoverflow.com/a/20170989
5020 struct static_string
5121 {
5222 template <std::size_t N>
53- explicit CONSTEXPR11_TN static_string (const char (&a)[N]) NOEXCEPT_TN : data(a),
54- size(N - 1 )
23+ explicit constexpr static_string (const char (&a)[N]) noexcept
24+ : data(a)
25+ , size(N - 1 )
5526 {
5627 }
5728
58- CONSTEXPR11_TN static_string (const char * a, const std::size_t sz) NOEXCEPT_TN : data(a),
59- size(sz)
29+ constexpr static_string (const char * a, const std::size_t sz) noexcept
30+ : data(a)
31+ , size(sz)
6032 {
6133 }
6234
@@ -65,18 +37,14 @@ namespace xt
6537 };
6638
6739 template <class T >
68- CONSTEXPR14_TN static_string type_name ()
40+ constexpr static_string type_name ()
6941 {
7042#ifdef __clang__
7143 static_string p (__PRETTY_FUNCTION__);
7244 return static_string (p.data + 39 , p.size - 39 - 1 );
7345#elif defined(__GNUC__)
7446 static_string p (__PRETTY_FUNCTION__);
75- #if __cplusplus < 201402
76- return static_string (p.data + 36 , p.size - 36 - 1 );
77- #else
7847 return static_string (p.data + 54 , p.size - 54 - 1 );
79- #endif
8048#elif defined(_MSC_VER)
8149 static const static_string p (__FUNCSIG__);
8250 return static_string (p.data + 47 , p.size - 47 - 7 );
0 commit comments