Currently there are (at least) 4 special functions that use unconditional abort/terminate to express that, they are not supposed to be called at runtime, but have to be defined for some reasons:
List
<functional>:
_Func_impl(_no_alloc)::_Target_type when !_HAS_STATIC_RTTI:
<future>:
_Fake_no_copy_callable_adapter's copy constructor:
|
_STD terminate(); // Very Bad Things
|
<xutility>:
projected(_Projected_impl)::operator *:
It's desirable to make them distinct from common noreturn functions, which are to be called to get noreturn behavior purposefully. Further, I think it's also desirable to do this in a unified way. Some questions are:
- Are the intents of these
abort/terminate exactly indentical(Nothing more than should not be called at runtime)?
- Is
_Fake_no_copy_callable_adapter's usage of terminate replaceable with abort?
- Is it desirable to replace direct usage of
abort with a specific utility(like a _MACRO()), to express the intent more clearly?
- Is
"abort" preferrable behavior in these conditions? Are there other candidates for it?
Currently there are (at least) 4 special functions that use unconditional
abort/terminateto express that, they are not supposed to be called at runtime, but have to be defined for some reasons:List
<functional>:_Func_impl(_no_alloc)::_Target_typewhen!_HAS_STATIC_RTTI:STL/stl/inc/functional
Line 756 in f51733c
STL/stl/inc/functional
Line 817 in f51733c
<future>:_Fake_no_copy_callable_adapter's copy constructor:STL/stl/inc/future
Line 1416 in f51733c
<xutility>:projected(_Projected_impl)::operator *:STL/stl/inc/xutility
Line 887 in f51733c
It's desirable to make them distinct from common noreturn functions, which are to be called to get noreturn behavior purposefully. Further, I think it's also desirable to do this in a unified way. Some questions are:
abort/terminateexactly indentical(Nothing more thanshould not be called at runtime)?_Fake_no_copy_callable_adapter's usage ofterminatereplaceable withabort?abortwith a specific utility(like a_MACRO()), to express the intent more clearly?"abort"preferrable behavior in these conditions? Are there other candidates for it?