Skip to content

Commit dff65a0

Browse files
committed
temp2
1 parent 59be0c4 commit dff65a0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/value_to.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ tag_invoke(
198198

199199
struct id
200200
{
201-
static constexpr auto& id1 = "Id#1";
202-
static constexpr auto& id2 = "Id#2";
201+
static constexpr char const* id1 = "Id#1";
202+
static constexpr char const* id2 = "Id#2";
203203

204204
std::size_t n;
205205
};
@@ -232,9 +232,9 @@ struct id_string_repr
232232

233233
id_string_repr(boost::json::string_view sv)
234234
{
235-
if( std::equal( sv.begin(), sv.end(), id::id1) )
235+
if( sv == boost::json::string_view(id::id1, 4) )
236236
n = 1;
237-
else if( std::equal( sv.begin(), sv.end(), id::id2) )
237+
else if( sv == boost::json::string_view(id::id2, 4) )
238238
n = 2;
239239
else
240240
throw std::runtime_error( "unknown id" );
@@ -249,8 +249,8 @@ struct id_string_repr
249249
{
250250
switch(n)
251251
{
252-
case 1: return boost::json::string_view(id::id1);
253-
case 2: return boost::json::string_view(id::id2);
252+
case 1: return boost::json::string_view(id::id1, 4);
253+
case 2: return boost::json::string_view(id::id2, 4);
254254
default: return boost::json::string_view("unknown");
255255
}
256256
}

0 commit comments

Comments
 (0)