From 7cc60ccc0a221b95761ab43aa522ce0fdafe86fa Mon Sep 17 00:00:00 2001 From: Jett Date: Thu, 20 Oct 2016 23:18:43 -0500 Subject: [PATCH] nl_isdigit can be made constexpr --- src/json.hpp | 2 +- src/json.hpp.re2c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 149bedae4..99561ea03 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -8802,7 +8802,7 @@ basic_json_parser_63: // non locale aware isdigit // Microsoft in 1252 codepage and others may classify additional single-byte characters as digits using std::isdigit - bool nl_isdigit(const char c) const + constexpr bool nl_isdigit(const char c) const { return c >= '0' and c <= '9'; } diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index ab0969350..166276c40 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -8099,7 +8099,7 @@ class basic_json // non locale aware isdigit // Microsoft in 1252 codepage and others may classify additional single-byte characters as digits using std::isdigit - bool nl_isdigit(const char c) const + constexpr bool nl_isdigit(const char c) const { return c >= '0' and c <= '9'; }