File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1277,7 +1277,13 @@ error: no matching constructor for initialization of '__get_node_value_type_t<va
1277
1277
// , integral_constant<bool, is_copy_constructible_v<_From> >()
1278
1278
// );
1279
1279
1280
+ // TODO: narrow it to "_From.first"
1280
1281
if constexpr (integral_constant<bool , is_copy_constructible_v<_From> >()) {
1282
+ // we use copy, and not "move" as the constraint
1283
+ // because we can NOT move from `const key_type`, which is how `value_type` is defined
1284
+ // atleast for map
1285
+ // typedef pair<const key_type, mapped_type> value_type;
1286
+ // so we must copy it
1281
1287
1282
1288
// const_cast is not allowed at constexpr time.
1283
1289
// we get around this by deleting __lhs and creating a new node in-place
@@ -1299,7 +1305,7 @@ error: no matching constructor for initialization of '__get_node_value_type_t<va
1299
1305
1300
1306
// (void)__lhs;
1301
1307
// (void)__rhs;
1302
- // static_assert(false, "Can not move from a pair<const T, U>");
1308
+ static_assert (false , " Can not move from a pair<const T, U>" );
1303
1309
// TODO: how do I flag this code to NOT run at compile time?
1304
1310
// Using static_assert means this can't compile _at all_, regardless of whether this code is actually going to execute at compile time or not
1305
1311
You can’t perform that action at this time.
0 commit comments