Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,13 @@ IncludeCategories:
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '(<seqan3/std/charconv>)'
Priority: 2
SortPriority: 1
CaseSensitive: false
- Regex: '(<[[:alnum:]._]+>|<seqan3/std/.*>)'
Priority: 2
SortPriority: 0
SortPriority: 2
CaseSensitive: false
- Regex: '<sdsl/'
Priority: 3
Expand Down
17 changes: 16 additions & 1 deletion include/seqan3/std/charconv
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,24 @@
#ifndef SEQAN_STD_CHARCONV_SHIM
#define SEQAN_STD_CHARCONV_SHIM

#include <version> // From C++20 onwards, all feature macros should be defined here.

// Workaround for llvm marking float charconv as unavailable
#if defined(__APPLE__) && defined(_LIBCPP_VERSION)
# ifdef _LIBCPP___CHARCONV_FROM_CHARS_FLOATING_POINT_H
# warning This file needs to be included before any <charconv> include.
# endif
# if __has_include(<__configuration/availability.h>)
# include <__configuration/availability.h>
# undef _LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT
# define _LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT /* nothing */
# undef _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT
# define _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT /* nothing */
# endif
#endif

#include <charconv>
#include <utility> // __cpp_lib_to_chars may be defined here as currently documented.
#include <version> // From C++20 onwards, all feature macros should be defined here.

/*!\defgroup std_charconv charconv
* \ingroup std
Expand Down
2 changes: 1 addition & 1 deletion test/unit/std/charconv_float_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

// make sure that including the std header does not produce any errors
// see https://github.com/seqan/seqan3/issues/2352
#include <seqan3/std/charconv>
#include <charconv>
#include <cmath>
#include <concepts>
#include <iostream>
#include <limits>
#include <seqan3/std/charconv>

// =============================================================================
// std::from_chars for float, double and long double
Expand Down
2 changes: 1 addition & 1 deletion test/unit/std/charconv_int_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

// make sure that including the std header does not produce any errors
// see https://github.com/seqan/seqan3/issues/2352
#include <seqan3/std/charconv>
#include <charconv>
#include <cmath>
#include <concepts>
#include <iostream>
#include <limits>
#include <seqan3/std/charconv>

// =============================================================================
// std::from_chars for integral types
Expand Down