Skip to content

Commit

Permalink
Make constexpr remove_prefix gcc version check tighter (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Feb 14, 2018
1 parent f3f19e7 commit 229887b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@
(defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910)
# include <string_view>
namespace fmt { using std::basic_string_view; }
// std::experimental::basic_string_view::remove_prefix isn't constexpr in gcc 6.
// std::experimental::basic_string_view::remove_prefix isn't constexpr until
// gcc 7.3.
#elif (FMT_HAS_INCLUDE(<experimental/string_view>) && \
(FMT_GCC_VERSION == 0 || FMT_GCC_VERSION >= 700) && \
(FMT_GCC_VERSION == 0 || FMT_GCC_VERSION >= 730) && \
__cplusplus >= 201402L)
# include <experimental/string_view>
namespace fmt { using std::experimental::basic_string_view; }
Expand Down Expand Up @@ -1065,8 +1066,8 @@ inline internal::named_arg<T, wchar_t> arg(wstring_view name, const T &arg) {

// This function template is deleted intentionally to disable nested named
// arguments as in ``format("{}", arg("a", arg("b", 42)))``.
template <typename S, typename... T>
void arg(S, internal::named_arg<T...>) FMT_DELETED;
template <typename S, typename T, typename Char>
void arg(S, internal::named_arg<T, Char>) FMT_DELETED;

enum Color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };

Expand Down

0 comments on commit 229887b

Please sign in to comment.