@@ -512,9 +512,8 @@ public:
512
512
virtual ~future_error () _NOEXCEPT;
513
513
};
514
514
515
- template <future_errc _Ev>
516
- _LIBCPP_ALWAYS_INLINE
517
- void __throw_future_error ()
515
+ inline _LIBCPP_ALWAYS_INLINE
516
+ void __throw_future_error (future_errc _Ev)
518
517
{
519
518
#ifndef _LIBCPP_NO_EXCEPTIONS
520
519
throw future_error (make_error_code (_Ev));
@@ -657,7 +656,7 @@ __assoc_state<_Rp>::set_value(_Arg& __arg)
657
656
{
658
657
unique_lock<mutex> __lk (this ->__mut_ );
659
658
if (this ->__has_value ())
660
- __throw_future_error< future_errc::promise_already_satisfied>( );
659
+ __throw_future_error ( future_errc::promise_already_satisfied);
661
660
::new (&__value_) _Rp (_VSTD::forward<_Arg>(__arg));
662
661
this ->__state_ |= base::__constructed | base::ready;
663
662
__cv_.notify_all ();
@@ -674,7 +673,7 @@ __assoc_state<_Rp>::set_value_at_thread_exit(_Arg& __arg)
674
673
{
675
674
unique_lock<mutex> __lk (this ->__mut_ );
676
675
if (this ->__has_value ())
677
- __throw_future_error< future_errc::promise_already_satisfied>( );
676
+ __throw_future_error ( future_errc::promise_already_satisfied);
678
677
::new (&__value_) _Rp (_VSTD::forward<_Arg>(__arg));
679
678
this ->__state_ |= base::__constructed;
680
679
__thread_local_data ()->__make_ready_at_thread_exit (this );
@@ -733,7 +732,7 @@ __assoc_state<_Rp&>::set_value(_Rp& __arg)
733
732
{
734
733
unique_lock<mutex> __lk (this ->__mut_ );
735
734
if (this ->__has_value ())
736
- __throw_future_error< future_errc::promise_already_satisfied>( );
735
+ __throw_future_error ( future_errc::promise_already_satisfied);
737
736
__value_ = _VSTD::addressof (__arg);
738
737
this ->__state_ |= base::__constructed | base::ready;
739
738
__cv_.notify_all ();
@@ -745,7 +744,7 @@ __assoc_state<_Rp&>::set_value_at_thread_exit(_Rp& __arg)
745
744
{
746
745
unique_lock<mutex> __lk (this ->__mut_ );
747
746
if (this ->__has_value ())
748
- __throw_future_error< future_errc::promise_already_satisfied>( );
747
+ __throw_future_error ( future_errc::promise_already_satisfied);
749
748
__value_ = _VSTD::addressof (__arg);
750
749
this ->__state_ |= base::__constructed;
751
750
__thread_local_data ()->__make_ready_at_thread_exit (this );
@@ -1142,7 +1141,7 @@ future<_Rp>::future(__assoc_state<_Rp>* __state)
1142
1141
: __state_ (__state)
1143
1142
{
1144
1143
if (__state_->__has_future_attached ())
1145
- __throw_future_error< future_errc::future_already_retrieved>( );
1144
+ __throw_future_error ( future_errc::future_already_retrieved);
1146
1145
__state_->__add_shared ();
1147
1146
__state_->__set_future_attached ();
1148
1147
}
@@ -1244,7 +1243,7 @@ future<_Rp&>::future(__assoc_state<_Rp&>* __state)
1244
1243
: __state_ (__state)
1245
1244
{
1246
1245
if (__state_->__has_future_attached ())
1247
- __throw_future_error< future_errc::future_already_retrieved>( );
1246
+ __throw_future_error ( future_errc::future_already_retrieved);
1248
1247
__state_->__add_shared ();
1249
1248
__state_->__set_future_attached ();
1250
1249
}
@@ -1445,7 +1444,7 @@ future<_Rp>
1445
1444
promise<_Rp>::get_future ()
1446
1445
{
1447
1446
if (__state_ == nullptr )
1448
- __throw_future_error< future_errc::no_state>( );
1447
+ __throw_future_error ( future_errc::no_state);
1449
1448
return future<_Rp>(__state_);
1450
1449
}
1451
1450
@@ -1454,7 +1453,7 @@ void
1454
1453
promise<_Rp>::set_value (const _Rp& __r)
1455
1454
{
1456
1455
if (__state_ == nullptr )
1457
- __throw_future_error< future_errc::no_state>( );
1456
+ __throw_future_error ( future_errc::no_state);
1458
1457
__state_->set_value (__r);
1459
1458
}
1460
1459
@@ -1465,7 +1464,7 @@ void
1465
1464
promise<_Rp>::set_value (_Rp&& __r)
1466
1465
{
1467
1466
if (__state_ == nullptr )
1468
- __throw_future_error< future_errc::no_state>( );
1467
+ __throw_future_error ( future_errc::no_state);
1469
1468
__state_->set_value (_VSTD::move (__r));
1470
1469
}
1471
1470
@@ -1476,7 +1475,7 @@ void
1476
1475
promise<_Rp>::set_exception (exception_ptr __p)
1477
1476
{
1478
1477
if (__state_ == nullptr )
1479
- __throw_future_error< future_errc::no_state>( );
1478
+ __throw_future_error ( future_errc::no_state);
1480
1479
__state_->set_exception (__p);
1481
1480
}
1482
1481
@@ -1485,7 +1484,7 @@ void
1485
1484
promise<_Rp>::set_value_at_thread_exit (const _Rp& __r)
1486
1485
{
1487
1486
if (__state_ == nullptr )
1488
- __throw_future_error< future_errc::no_state>( );
1487
+ __throw_future_error ( future_errc::no_state);
1489
1488
__state_->set_value_at_thread_exit (__r);
1490
1489
}
1491
1490
@@ -1496,7 +1495,7 @@ void
1496
1495
promise<_Rp>::set_value_at_thread_exit (_Rp&& __r)
1497
1496
{
1498
1497
if (__state_ == nullptr )
1499
- __throw_future_error< future_errc::no_state>( );
1498
+ __throw_future_error ( future_errc::no_state);
1500
1499
__state_->set_value_at_thread_exit (_VSTD::move (__r));
1501
1500
}
1502
1501
@@ -1507,7 +1506,7 @@ void
1507
1506
promise<_Rp>::set_exception_at_thread_exit (exception_ptr __p)
1508
1507
{
1509
1508
if (__state_ == nullptr )
1510
- __throw_future_error< future_errc::no_state>( );
1509
+ __throw_future_error ( future_errc::no_state);
1511
1510
__state_->set_exception_at_thread_exit (__p);
1512
1511
}
1513
1512
@@ -1605,7 +1604,7 @@ future<_Rp&>
1605
1604
promise<_Rp&>::get_future ()
1606
1605
{
1607
1606
if (__state_ == nullptr )
1608
- __throw_future_error< future_errc::no_state>( );
1607
+ __throw_future_error ( future_errc::no_state);
1609
1608
return future<_Rp&>(__state_);
1610
1609
}
1611
1610
@@ -1614,7 +1613,7 @@ void
1614
1613
promise<_Rp&>::set_value (_Rp& __r)
1615
1614
{
1616
1615
if (__state_ == nullptr )
1617
- __throw_future_error< future_errc::no_state>( );
1616
+ __throw_future_error ( future_errc::no_state);
1618
1617
__state_->set_value (__r);
1619
1618
}
1620
1619
@@ -1623,7 +1622,7 @@ void
1623
1622
promise<_Rp&>::set_exception (exception_ptr __p)
1624
1623
{
1625
1624
if (__state_ == nullptr )
1626
- __throw_future_error< future_errc::no_state>( );
1625
+ __throw_future_error ( future_errc::no_state);
1627
1626
__state_->set_exception (__p);
1628
1627
}
1629
1628
@@ -1632,7 +1631,7 @@ void
1632
1631
promise<_Rp&>::set_value_at_thread_exit (_Rp& __r)
1633
1632
{
1634
1633
if (__state_ == nullptr )
1635
- __throw_future_error< future_errc::no_state>( );
1634
+ __throw_future_error ( future_errc::no_state);
1636
1635
__state_->set_value_at_thread_exit (__r);
1637
1636
}
1638
1637
@@ -1641,7 +1640,7 @@ void
1641
1640
promise<_Rp&>::set_exception_at_thread_exit (exception_ptr __p)
1642
1641
{
1643
1642
if (__state_ == nullptr )
1644
- __throw_future_error< future_errc::no_state>( );
1643
+ __throw_future_error ( future_errc::no_state);
1645
1644
__state_->set_exception_at_thread_exit (__p);
1646
1645
}
1647
1646
@@ -2063,9 +2062,9 @@ void
2063
2062
packaged_task<_Rp (_ArgTypes...)>::operator ()(_ArgTypes... __args)
2064
2063
{
2065
2064
if (__p_.__state_ == nullptr )
2066
- __throw_future_error< future_errc::no_state>( );
2065
+ __throw_future_error ( future_errc::no_state);
2067
2066
if (__p_.__state_ ->__has_value ())
2068
- __throw_future_error< future_errc::promise_already_satisfied>( );
2067
+ __throw_future_error ( future_errc::promise_already_satisfied);
2069
2068
#ifndef _LIBCPP_NO_EXCEPTIONS
2070
2069
try
2071
2070
{
@@ -2085,9 +2084,9 @@ void
2085
2084
packaged_task<_Rp (_ArgTypes...)>::make_ready_at_thread_exit (_ArgTypes... __args)
2086
2085
{
2087
2086
if (__p_.__state_ == nullptr )
2088
- __throw_future_error< future_errc::no_state>( );
2087
+ __throw_future_error ( future_errc::no_state);
2089
2088
if (__p_.__state_ ->__has_value ())
2090
- __throw_future_error< future_errc::promise_already_satisfied>( );
2089
+ __throw_future_error ( future_errc::promise_already_satisfied);
2091
2090
#ifndef _LIBCPP_NO_EXCEPTIONS
2092
2091
try
2093
2092
{
@@ -2107,7 +2106,7 @@ void
2107
2106
packaged_task<_Rp (_ArgTypes...)>::reset ()
2108
2107
{
2109
2108
if (!valid ())
2110
- __throw_future_error< future_errc::no_state>( );
2109
+ __throw_future_error ( future_errc::no_state);
2111
2110
__p_ = promise<result_type>();
2112
2111
}
2113
2112
@@ -2192,9 +2191,9 @@ void
2192
2191
packaged_task<void (_ArgTypes...)>::operator ()(_ArgTypes... __args)
2193
2192
{
2194
2193
if (__p_.__state_ == nullptr )
2195
- __throw_future_error< future_errc::no_state>( );
2194
+ __throw_future_error ( future_errc::no_state);
2196
2195
if (__p_.__state_ ->__has_value ())
2197
- __throw_future_error< future_errc::promise_already_satisfied>( );
2196
+ __throw_future_error ( future_errc::promise_already_satisfied);
2198
2197
#ifndef _LIBCPP_NO_EXCEPTIONS
2199
2198
try
2200
2199
{
@@ -2215,9 +2214,9 @@ void
2215
2214
packaged_task<void (_ArgTypes...)>::make_ready_at_thread_exit (_ArgTypes... __args)
2216
2215
{
2217
2216
if (__p_.__state_ == nullptr )
2218
- __throw_future_error< future_errc::no_state>( );
2217
+ __throw_future_error ( future_errc::no_state);
2219
2218
if (__p_.__state_ ->__has_value ())
2220
- __throw_future_error< future_errc::promise_already_satisfied>( );
2219
+ __throw_future_error ( future_errc::promise_already_satisfied);
2221
2220
#ifndef _LIBCPP_NO_EXCEPTIONS
2222
2221
try
2223
2222
{
@@ -2238,7 +2237,7 @@ void
2238
2237
packaged_task<void (_ArgTypes...)>::reset ()
2239
2238
{
2240
2239
if (!valid ())
2241
- __throw_future_error< future_errc::no_state>( );
2240
+ __throw_future_error ( future_errc::no_state);
2242
2241
__p_ = promise<result_type>();
2243
2242
}
2244
2243
0 commit comments