Skip to content

Commit

Permalink
Fallback on std version when feature is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Apr 27, 2016
1 parent dde1ce1 commit c48b0cb
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions include/fit/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
#define FIT_GUARD_CONFIG_HPP


// Check for std version
#if __cplusplus >= 201402
#define FIT_HAS_STD_14 1
#else
#define FIT_HAS_STD_14 0
#endif

#if __cplusplus >= 201103
#define FIT_HAS_STD_11 1
#else
#define FIT_HAS_STD_11 0
#endif


// This determines if it safe to use inheritance for EBO. On every platform
// except clang, compilers have problems with ambigous base conversion. So
// this configures the library to use a different technique to achieve empty
Expand Down Expand Up @@ -50,7 +64,7 @@
#define FIT_HAS_RELAXED_CONSTEXPR 0
#endif
#else
#define FIT_HAS_RELAXED_CONSTEXPR 0
#define FIT_HAS_RELAXED_CONSTEXPR !FIT_HAS_STD_14
#endif
#endif

Expand All @@ -59,7 +73,7 @@
#if defined(__cpp_generic_lambdas) || defined(_MSC_VER)
#define FIT_HAS_GENERIC_LAMBDA 1
#else
#define FIT_HAS_GENERIC_LAMBDA 0
#define FIT_HAS_GENERIC_LAMBDA !FIT_HAS_STD_14
#endif
#endif

Expand Down

0 comments on commit c48b0cb

Please sign in to comment.