Skip to content

Commit 42c8fe7

Browse files
committed
fix: ci_less::operator() return type
1 parent 81fcb95 commit 42c8fe7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

include/boost/url/grammar/ci_string.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ struct ci_less
330330
{
331331
using is_transparent = void;
332332

333-
std::size_t
333+
bool
334334
operator()(
335335
core::string_view s0,
336336
core::string_view s1) const noexcept

test/unit/grammar/ci_string.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <map>
2020
#include <memory>
2121
#include <string>
22+
#include <type_traits>
2223
#include <unordered_map>
2324

2425
namespace boost {
@@ -103,6 +104,12 @@ class ascii_test
103104

104105
BOOST_TEST(ci_less{}("a", "aa"));
105106
BOOST_TEST(! ci_less{}("xy", "z"));
107+
108+
// ci_less::operator() must return bool,
109+
// not std::size_t
110+
static_assert(std::is_same<
111+
decltype(ci_less{}("a", "b")),
112+
bool>::value, "");
106113
}
107114

108115
void

0 commit comments

Comments
 (0)