@@ -565,21 +565,23 @@ namespace jsoncons {
565
565
{
566
566
}
567
567
568
- json_object& operator =(const json_object& val)
569
- {
570
- allocator_holder<allocator_type>::operator =(val.get_allocator ());
571
- members_ = val.members_ ;
572
- }
573
-
574
568
json_object (json_object&& val)
575
569
: allocator_holder<allocator_type>(val.get_allocator()),
576
570
members_ (std::move(val.members_))
577
571
{
578
572
}
579
573
574
+ json_object& operator =(const json_object& val)
575
+ {
576
+ allocator_holder<allocator_type>::operator =(val.get_allocator ());
577
+ members_ = val.members_ ;
578
+ return *this ;
579
+ }
580
+
580
581
json_object& operator =(json_object&& val)
581
582
{
582
583
val.swap (*this );
584
+ return *this ;
583
585
}
584
586
585
587
json_object (const json_object& val, const allocator_type& alloc)
@@ -1265,25 +1267,13 @@ namespace jsoncons {
1265
1267
{
1266
1268
}
1267
1269
1268
- json_object& operator =(const json_object& val)
1269
- {
1270
- allocator_holder<allocator_type>::operator =(val.get_allocator ());
1271
- members_ = val.members_ ;
1272
- index_ = val.index_ ;
1273
- }
1274
-
1275
1270
json_object (json_object&& val)
1276
1271
: allocator_holder<allocator_type>(val.get_allocator()),
1277
1272
members_ (std::move(val.members_)),
1278
1273
index_ (std::move(val.index_))
1279
1274
{
1280
1275
}
1281
1276
1282
- json_object& operator =(json_object&& val)
1283
- {
1284
- val.swap (*this );
1285
- }
1286
-
1287
1277
json_object (const json_object& val, const allocator_type& alloc)
1288
1278
: allocator_holder<allocator_type>(alloc),
1289
1279
members_ (val.members_,key_value_allocator_type(alloc)),
@@ -1390,6 +1380,20 @@ namespace jsoncons {
1390
1380
destroy ();
1391
1381
}
1392
1382
1383
+ json_object& operator =(json_object&& val)
1384
+ {
1385
+ val.swap (*this );
1386
+ return *this ;
1387
+ }
1388
+
1389
+ json_object& operator =(const json_object& val)
1390
+ {
1391
+ allocator_holder<allocator_type>::operator =(val.get_allocator ());
1392
+ members_ = val.members_ ;
1393
+ index_ = val.index_ ;
1394
+ return *this ;
1395
+ }
1396
+
1393
1397
void swap (json_object& val) noexcept
1394
1398
{
1395
1399
members_.swap (val.members_ );
0 commit comments