Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions stl/inc/functional
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,8 @@ _NODISCARD void* _Function_new_large(_CTypes&&... _Args) {
template <class _Rx, bool _Noexcept, class... _Types>
class _Move_only_function_base {
public:
using result_type = _Rx;

struct _Impl_t { // A per-callable-type structure acting as a virtual function table.
// Using vtable emulations gives more flexibility for optimizations and reduces the amount of RTTI data.
// (The RTTI savings may be significant as with lambdas and binds there may be many distinct callable types.
Expand Down Expand Up @@ -1719,8 +1721,6 @@ class _Move_only_function_call {
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...)> : public _Move_only_function_base<_Rx, false, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = _Vt&;

Expand All @@ -1736,8 +1736,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) &> : public _Move_only_function_base<_Rx, false, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = _Vt&;

Expand All @@ -1752,8 +1750,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) &&> : public _Move_only_function_base<_Rx, false, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = _Vt&&;

Expand All @@ -1768,8 +1764,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) const> : public _Move_only_function_base<_Rx, false, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = const _Vt&;

Expand All @@ -1785,8 +1779,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) const&> : public _Move_only_function_base<_Rx, false, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = const _Vt&;

Expand All @@ -1801,8 +1793,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) const&&> : public _Move_only_function_base<_Rx, false, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = const _Vt&&;

Expand All @@ -1818,8 +1808,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) noexcept> : public _Move_only_function_base<_Rx, true, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = _Vt&;

Expand All @@ -1835,8 +1823,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) & noexcept> : public _Move_only_function_base<_Rx, true, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = _Vt&;

Expand All @@ -1851,8 +1837,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) && noexcept> : public _Move_only_function_base<_Rx, true, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = _Vt&&;

Expand All @@ -1867,8 +1851,6 @@ public:
template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) const noexcept> : public _Move_only_function_base<_Rx, true, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = const _Vt&;

Expand All @@ -1885,8 +1867,6 @@ template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) const & noexcept>
: public _Move_only_function_base<_Rx, true, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = const _Vt&;

Expand All @@ -1902,8 +1882,6 @@ template <class _Rx, class... _Types>
class _Move_only_function_call<_Rx(_Types...) const && noexcept>
: public _Move_only_function_base<_Rx, true, _Types...> {
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = const _Vt&&;

Expand Down
4 changes: 1 addition & 3 deletions tools/scripts/move_only_function_specializations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ def specialization(cv: str, ref: str, ref_inv: str, noex: str, noex_val: str, ca
class _Move_only_function_call<_Rx(_Types...) {cv} {ref} {noex}>
: public _Move_only_function_base<_Rx, {noex_val}, _Types...> {{
public:
using result_type = _Rx;

template <class _Vt>
using _VtInvQuals = {cv} _Vt {ref_inv};

Expand Down Expand Up @@ -39,4 +37,4 @@ def cvref_permutations(noex: str, noex_val: str, trait: str) -> str:
print(cvref_permutations("", "false", "is_invocable_r_v") + "\n" \
+ "#ifdef __cpp_noexcept_function_type" + "\n" \
+ cvref_permutations("noexcept", "true", "is_nothrow_invocable_r_v") \
+ "#endif // __cpp_noexcept_function_type")
+ "#endif // defined(__cpp_noexcept_function_type)")