зеркало из https://github.com/microsoft/STL.git
Explain why invoke is implemented with a macro (#368)
This commit is contained in:
Родитель
07e032b3d3
Коммит
70e49a0156
|
@ -1476,6 +1476,11 @@ _NODISCARD constexpr conditional_t<!is_nothrow_move_constructible_v<_Ty> && is_c
|
|||
template <class _Ty>
|
||||
class reference_wrapper;
|
||||
|
||||
// std::invoke isn't constexpr in C++17, and implementers are forbidden from "strengthening" constexpr (WG21-N4842
|
||||
// [constexpr.functions]/1), yet both std::apply and std::visit are required to be constexpr and have invoke-like
|
||||
// behavior. We solve this by using a macro to stamp out both public non-constexpr and internal constexpr
|
||||
// implementations. TRANSITION, P1065R2
|
||||
|
||||
#define _CONCATX(x, y) x##y
|
||||
#define _CONCAT(x, y) _CONCATX(x, y)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче