Skip to content

Commit

Permalink
temp2
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Jan 14, 2025
1 parent 59be0c4 commit dff65a0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/value_to.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ tag_invoke(

struct id
{
static constexpr auto& id1 = "Id#1";
static constexpr auto& id2 = "Id#2";
static constexpr char const* id1 = "Id#1";
static constexpr char const* id2 = "Id#2";

std::size_t n;
};
Expand Down Expand Up @@ -232,9 +232,9 @@ struct id_string_repr

id_string_repr(boost::json::string_view sv)
{
if( std::equal( sv.begin(), sv.end(), id::id1) )
if( sv == boost::json::string_view(id::id1, 4) )
n = 1;
else if( std::equal( sv.begin(), sv.end(), id::id2) )
else if( sv == boost::json::string_view(id::id2, 4) )
n = 2;
else
throw std::runtime_error( "unknown id" );
Expand All @@ -249,8 +249,8 @@ struct id_string_repr
{
switch(n)
{
case 1: return boost::json::string_view(id::id1);
case 2: return boost::json::string_view(id::id2);
case 1: return boost::json::string_view(id::id1, 4);
case 2: return boost::json::string_view(id::id2, 4);
default: return boost::json::string_view("unknown");
}
}
Expand Down

0 comments on commit dff65a0

Please sign in to comment.