Skip to content

Commit

Permalink
noexceptify expected
Browse files Browse the repository at this point in the history
  • Loading branch information
eliaskosunen committed May 23, 2024
1 parent 1b567b6 commit 87f37a1
Show file tree
Hide file tree
Showing 2 changed files with 388 additions and 260 deletions.
15 changes: 15 additions & 0 deletions include/scn/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,14 @@ SCN_GCC_POP
#define SCN_HAS_TRIVIAL_ABI 0
#endif

// Detect explicit(bool)
#if defined(__cpp_conditional_explicit) && \
__cpp_conditional_explicit >= 201806L && SCN_STD >= SCN_STD_20
#define SCN_HAS_CONDITIONAL_EXPLICIT 1
#else
#define SCN_HAS_CONDITIONAL_EXPLICIT 0
#endif

// Detect <charconv>

#if SCN_STD >= SCN_STD_17
Expand Down Expand Up @@ -830,6 +838,13 @@ SCN_GCC_POP
#define SCN_TRIVIAL_ABI /*trivial_abi*/
#endif

// SCN_IMPLICIT
#if SCN_HAS_CONDITIONAL_EXPLICIT
#define SCN_IMPLICIT explicit(false)
#else
#define SCN_IMPLICIT /*implicit*/
#endif

// SCN_LIKELY & SCN_UNLIKELY
#if SCN_HAS_BUILTIN_EXPECT
#define SCN_LIKELY(x) __builtin_expect(!!(x), 1)
Expand Down
Loading

0 comments on commit 87f37a1

Please sign in to comment.