@@ -57,15 +57,11 @@ namespace detail
57
57
// Void does nothing
58
58
template <> struct move_assign_to_empty <void , false , false >
59
59
{
60
- move_assign_to_empty (void *, void *) noexcept
61
- { /* nothing to assign */
62
- }
60
+ move_assign_to_empty (void *, void *) noexcept { /* nothing to assign */ }
63
61
};
64
62
template <> struct move_assign_to_empty <const void , false , false >
65
63
{
66
- move_assign_to_empty (const void *, const void *) noexcept
67
- { /* nothing to assign */
68
- }
64
+ move_assign_to_empty (const void *, const void *) noexcept { /* nothing to assign */ }
69
65
};
70
66
// Helpers for copy assigning to empty storage
71
67
template <class T , bool isCopyConstructible = std::is_copy_constructible<T>::value,
@@ -92,15 +88,11 @@ namespace detail
92
88
// Void does nothing
93
89
template <> struct copy_assign_to_empty <void , false , false >
94
90
{
95
- copy_assign_to_empty (void *, void *) noexcept
96
- { /* nothing to assign */
97
- }
91
+ copy_assign_to_empty (void *, void *) noexcept { /* nothing to assign */ }
98
92
};
99
93
template <> struct copy_assign_to_empty <const void , false , false >
100
94
{
101
- copy_assign_to_empty (const void *, const void *) noexcept
102
- { /* nothing to assign */
103
- }
95
+ copy_assign_to_empty (const void *, const void *) noexcept { /* nothing to assign */ }
104
96
};
105
97
106
98
template <class T , bool nothrow> struct strong_swap_impl
@@ -231,9 +223,10 @@ namespace detail
231
223
#ifdef _MSC_VER
232
224
__declspec (noreturn)
233
225
#elif defined(__GNUC__) || defined(__clang__)
234
- __attribute__ ((noreturn))
226
+ __attribute__ ((noreturn))
235
227
#endif
236
- void make_ub (T && /* unused*/ )
228
+ void
229
+ make_ub (T && /* unused*/ )
237
230
{
238
231
OUTCOME_ASSERT (false ); // NOLINT
239
232
#if defined(__GNUC__) || defined(__clang__)
@@ -1286,11 +1279,11 @@ namespace detail
1286
1279
// value/value
1287
1280
if (_status.have_value () && o._status .have_value ())
1288
1281
{
1289
- struct _
1282
+ struct some_type
1290
1283
{
1291
1284
status_bitfield_type &a, &b;
1292
1285
bool all_good{false };
1293
- ~_ ()
1286
+ ~some_type ()
1294
1287
{
1295
1288
if (!this ->all_good )
1296
1289
{
@@ -1299,19 +1292,19 @@ namespace detail
1299
1292
this ->b .set_have_lost_consistency (true );
1300
1293
}
1301
1294
}
1302
- } _ {_status, o._status };
1303
- strong_swap (_ .all_good , _value, o._value );
1295
+ } some_type_value {_status, o._status };
1296
+ strong_swap (some_type_value .all_good , _value, o._value );
1304
1297
swap (_status, o._status );
1305
1298
return ;
1306
1299
}
1307
1300
// error/error
1308
1301
if (_status.have_error () && o._status .have_error ())
1309
1302
{
1310
- struct _
1303
+ struct some_type
1311
1304
{
1312
1305
status_bitfield_type &a, &b;
1313
1306
bool all_good{false };
1314
- ~_ ()
1307
+ ~some_type ()
1315
1308
{
1316
1309
if (!this ->all_good )
1317
1310
{
@@ -1320,8 +1313,8 @@ namespace detail
1320
1313
this ->b .set_have_lost_consistency (true );
1321
1314
}
1322
1315
}
1323
- } _ {_status, o._status };
1324
- strong_swap (_ .all_good , _error, o._error );
1316
+ } some_type_value {_status, o._status };
1317
+ strong_swap (some_type_value .all_good , _error, o._error );
1325
1318
swap (_status, o._status );
1326
1319
return ;
1327
1320
}
@@ -1371,13 +1364,13 @@ namespace detail
1371
1364
return ;
1372
1365
}
1373
1366
// It can now only be value/error, or error/value
1374
- struct _
1367
+ struct some_type
1375
1368
{
1376
1369
status_bitfield_type &a, &b;
1377
1370
_value_type_ *value, *o_value;
1378
1371
_error_type_ *error, *o_error;
1379
1372
bool all_good{true };
1380
- ~_ ()
1373
+ ~some_type ()
1381
1374
{
1382
1375
if (!this ->all_good )
1383
1376
{
@@ -1386,21 +1379,21 @@ namespace detail
1386
1379
this ->b .set_have_lost_consistency (true );
1387
1380
}
1388
1381
}
1389
- } _ {_status, o._status , OUTCOME_ADDRESS_OF (_value), OUTCOME_ADDRESS_OF (o._value ), OUTCOME_ADDRESS_OF (_error), OUTCOME_ADDRESS_OF (o._error )};
1382
+ } some_type_value {_status, o._status , OUTCOME_ADDRESS_OF (_value), OUTCOME_ADDRESS_OF (o._value ), OUTCOME_ADDRESS_OF (_error), OUTCOME_ADDRESS_OF (o._error )};
1390
1383
if (_status.have_value () && o._status .have_error ())
1391
1384
{
1392
- strong_placement (_ .all_good , _ .o_value , _ .value , [&_ ] { //
1393
- strong_placement (_ .all_good , _ .error , _ .o_error , [&_ ] { //
1394
- swap (_ .a , _ .b ); //
1385
+ strong_placement (some_type_value .all_good , some_type_value .o_value , some_type_value .value , [&some_type_value ] { //
1386
+ strong_placement (some_type_value .all_good , some_type_value .error , some_type_value .o_error , [&some_type_value ] { //
1387
+ swap (some_type_value .a , some_type_value .b ); //
1395
1388
});
1396
1389
});
1397
1390
return ;
1398
1391
}
1399
1392
if (_status.have_error () && o._status .have_value ())
1400
1393
{
1401
- strong_placement (_ .all_good , _ .o_error , _ .error , [&_ ] { //
1402
- strong_placement (_ .all_good , _ .value , _ .o_value , [&_ ] { //
1403
- swap (_ .a , _ .b ); //
1394
+ strong_placement (some_type_value .all_good , some_type_value .o_error , some_type_value .error , [&some_type_value ] { //
1395
+ strong_placement (some_type_value .all_good , some_type_value .value , some_type_value .o_value , [&some_type_value ] { //
1396
+ swap (some_type_value .a , some_type_value .b ); //
1404
1397
});
1405
1398
});
1406
1399
return ;
@@ -1471,12 +1464,12 @@ namespace detail
1471
1464
constexpr
1472
1465
#endif
1473
1466
value_storage_nontrivial_move_assignment &
1474
- operator =(value_storage_nontrivial_move_assignment &&o) noexcept (
1475
- std::is_nothrow_move_assignable<value_type >::value &&
1476
- std::is_nothrow_move_assignable<error_type>::value && noexcept (move_assign_to_empty<value_type>(
1477
- static_cast <value_type *>(nullptr ),
1478
- static_cast <value_type *>( nullptr ))) && noexcept (move_assign_to_empty<error_type>(static_cast <error_type *>(nullptr ),
1479
- static_cast <error_type *>(nullptr )))) // NOLINT
1467
+ operator =(value_storage_nontrivial_move_assignment &&o) noexcept (std::is_nothrow_move_assignable<value_type>::value &&
1468
+ std::is_nothrow_move_assignable<error_type >::value &&
1469
+ noexcept (move_assign_to_empty<value_type>(static_cast <value_type *>( nullptr ),
1470
+ static_cast <value_type *>(nullptr ))) &&
1471
+ noexcept (move_assign_to_empty<error_type>(static_cast <error_type *>(nullptr ),
1472
+ static_cast <error_type *>(nullptr )))) // NOLINT
1480
1473
{
1481
1474
using _value_type_ = typename Base::_value_type_;
1482
1475
using _error_type_ = typename Base::_error_type_;
@@ -1575,10 +1568,9 @@ namespace detail
1575
1568
#endif
1576
1569
value_storage_nontrivial_copy_assignment &
1577
1570
operator =(const value_storage_nontrivial_copy_assignment &o) noexcept (
1578
- std::is_nothrow_copy_assignable<value_type>::value &&
1579
- std::is_nothrow_copy_assignable<error_type>::value && noexcept (copy_assign_to_empty<value_type>(
1580
- static_cast <value_type *>(nullptr ), static_cast <value_type *>(nullptr ))) && noexcept (copy_assign_to_empty<error_type>(static_cast <error_type *>(nullptr ),
1581
- static_cast <error_type *>(nullptr ))))
1571
+ std::is_nothrow_copy_assignable<value_type>::value && std::is_nothrow_copy_assignable<error_type>::value &&
1572
+ noexcept (copy_assign_to_empty<value_type>(static_cast <value_type *>(nullptr ), static_cast <value_type *>(nullptr ))) &&
1573
+ noexcept (copy_assign_to_empty<error_type>(static_cast <error_type *>(nullptr ), static_cast <error_type *>(nullptr ))))
1582
1574
{
1583
1575
using _value_type_ = typename Base::_value_type_;
1584
1576
using _error_type_ = typename Base::_error_type_;
0 commit comments