Skip to content

Commit

Permalink
Add macro nsel_deprecated(msg) (#66, thanks @psyinf)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmoene committed Jun 4, 2024
1 parent f1eb819 commit f2e88d0
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions include/nonstd/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,16 +342,6 @@ namespace nonstd {
#define nsel_REQUIRES_A(...) \
, typename std::enable_if< (__VA_ARGS__), void*>::type = nullptr

// Presence of language and library features:

#ifdef _HAS_CPP0X
# define nsel_HAS_CPP0X _HAS_CPP0X
#else
# define nsel_HAS_CPP0X 0
#endif

//#define nsel_CPP11_140 (nsel_CPP11_OR_GREATER || nsel_COMPILER_MSVC_VER >= 1900)

// Clang, GNUC, MSVC warning suppression macros:

#ifdef __clang__
Expand Down Expand Up @@ -385,6 +375,30 @@ namespace nonstd {

nsel_DISABLE_MSVC_WARNINGS( 26409 )

// Presence of language and library features:

#ifdef _HAS_CPP0X
# define nsel_HAS_CPP0X _HAS_CPP0X
#else
# define nsel_HAS_CPP0X 0
#endif

// Presence of language and library features:

#define nsel_CPP17_000 (nsel_CPP17_OR_GREATER)

// Presence of C++17 language features:

#define nsel_HAVE_DEPRECATED nsel_CPP17_000

// C++ feature usage:

#if nsel_HAVE_DEPRECATED
# define nsel_deprecated(msg) [[deprecated(msg)]]
#else
# define nsel_deprecated(msg) /*[[deprecated]]*/
#endif

//
// expected:
//
Expand Down

0 comments on commit f2e88d0

Please sign in to comment.