Skip to content

Commit

Permalink
Added a recursive switch implementation for C++14/17.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpark committed Jan 9, 2019
1 parent b2b6526 commit 62b41fe
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 67 deletions.
12 changes: 12 additions & 0 deletions include/mpark/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#error "MPark.Variant requires C++11 support."
#endif

#ifndef __has_attribute
#define __has_attribute(x) 0
#endif

#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
Expand All @@ -25,6 +29,14 @@
#define __has_feature(x) 0
#endif

#if __has_attribute(always_inline) || defined(__GNUC__)
#define MPARK_ALWAYS_INLINE __attribute__((__always_inline__)) inline
#elif defined(_MSC_VER)
#define MPARK_ALWAYS_INLINE __forceinline
#else
#define MPARK_ALWAYS_INLINE inline
#endif

#if __has_builtin(__builtin_addressof) || \
(defined(__GNUC__) && __GNUC__ >= 7) || defined(_MSC_VER)
#define MPARK_BUILTIN_ADDRESSOF
Expand Down
Loading

0 comments on commit 62b41fe

Please sign in to comment.