33#include " ada/common_defs.h" // make sure ADA_IS_BIG_ENDIAN gets defined.
44#include " ada/scheme.h"
55
6- #include < algorithm>
7- #include < charconv>
86#include < cstring>
97#include < sstream>
108
@@ -159,8 +157,8 @@ ada_really_inline void remove_ascii_tab_or_newline(
159157 input.end ());
160158}
161159
162- ada_really_inline std::string_view substring (std::string_view input,
163- size_t pos) noexcept {
160+ ada_really_inline constexpr std::string_view substring (std::string_view input,
161+ size_t pos) noexcept {
164162 ADA_ASSERT_TRUE (pos <= input.size ());
165163 // The following is safer but unneeded if we have the above line:
166164 // return pos > input.size() ? std::string_view() : input.substr(pos);
@@ -317,7 +315,7 @@ ada_really_inline size_t find_next_host_delimiter_special(
317315#else
318316// : / [ \\ ?
319317static constexpr std::array<uint8_t , 256 > special_host_delimiters =
320- []() constexpr {
318+ []() consteval {
321319 std::array<uint8_t , 256 > result{};
322320 for (int i : {' :' , ' /' , ' [' , ' \\ ' , ' ?' }) {
323321 result[i] = 1 ;
@@ -449,7 +447,7 @@ ada_really_inline size_t find_next_host_delimiter(std::string_view view,
449447}
450448#else
451449// : / [ ?
452- static constexpr std::array<uint8_t , 256 > host_delimiters = []() constexpr {
450+ static constexpr std::array<uint8_t , 256 > host_delimiters = []() consteval {
453451 std::array<uint8_t , 256 > result{};
454452 for (int i : {' :' , ' /' , ' ?' , ' [' }) {
455453 result[i] = 1 ;
@@ -744,7 +742,7 @@ ada_really_inline void strip_trailing_spaces_from_opaque_path(
744742
745743// @ / \\ ?
746744static constexpr std::array<uint8_t , 256 > authority_delimiter_special =
747- []() constexpr {
745+ []() consteval {
748746 std::array<uint8_t , 256 > result{};
749747 for (uint8_t i : {' @' , ' /' , ' \\ ' , ' ?' }) {
750748 result[i] = 1 ;
@@ -765,7 +763,7 @@ find_authority_delimiter_special(std::string_view view) noexcept {
765763}
766764
767765// @ / ?
768- static constexpr std::array<uint8_t , 256 > authority_delimiter = []() constexpr {
766+ static constexpr std::array<uint8_t , 256 > authority_delimiter = []() consteval {
769767 std::array<uint8_t , 256 > result{};
770768 for (uint8_t i : {' @' , ' /' , ' ?' }) {
771769 result[i] = 1 ;
0 commit comments