functional (0b57cec536236d46e3dba9bd041533462f33dbb7) functional (e40139ff33b48b56a24c808b166b04b8ee6f5b21)
1// -*- C++ -*-
2//===------------------------ functional ----------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//

--- 426 unchanged lines hidden (view full) ---

435 R operator()(ArgTypes...) const;
436
437 // function target access:
438 const std::type_info& target_type() const noexcept;
439 template <typename T> T* target() noexcept;
440 template <typename T> const T* target() const noexcept;
441};
442
1// -*- C++ -*-
2//===------------------------ functional ----------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//

--- 426 unchanged lines hidden (view full) ---

435 R operator()(ArgTypes...) const;
436
437 // function target access:
438 const std::type_info& target_type() const noexcept;
439 template <typename T> T* target() noexcept;
440 template <typename T> const T* target() const noexcept;
441};
442
443// Deduction guides
444template<class R, class ...Args>
445function(R(*)(Args...)) -> function<R(Args...)>; // since C++17
446
447template<class F>
448function(F) -> function<see-below>; // since C++17
449
443// Null pointer comparisons:
444template <class R, class ... ArgTypes>
445 bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
446
447template <class R, class ... ArgTypes>
448 bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
449
450template <class R, class ... ArgTypes>

--- 1879 unchanged lines hidden (view full) ---

2330#ifndef _LIBCPP_NO_RTTI
2331 // function target access:
2332 const std::type_info& target_type() const _NOEXCEPT;
2333 template <typename _Tp> _Tp* target() _NOEXCEPT;
2334 template <typename _Tp> const _Tp* target() const _NOEXCEPT;
2335#endif // _LIBCPP_NO_RTTI
2336};
2337
450// Null pointer comparisons:
451template <class R, class ... ArgTypes>
452 bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
453
454template <class R, class ... ArgTypes>
455 bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
456
457template <class R, class ... ArgTypes>

--- 1879 unchanged lines hidden (view full) ---

2337#ifndef _LIBCPP_NO_RTTI
2338 // function target access:
2339 const std::type_info& target_type() const _NOEXCEPT;
2340 template <typename _Tp> _Tp* target() _NOEXCEPT;
2341 template <typename _Tp> const _Tp* target() const _NOEXCEPT;
2342#endif // _LIBCPP_NO_RTTI
2343};
2344
2345#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
2346template<class _Rp, class ..._Ap>
2347function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
2348
2349template<class _Fp>
2350struct __strip_signature;
2351
2352template<class _Rp, class _Gp, class ..._Ap>
2353struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); };
2354template<class _Rp, class _Gp, class ..._Ap>
2355struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); };
2356template<class _Rp, class _Gp, class ..._Ap>
2357struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); };
2358template<class _Rp, class _Gp, class ..._Ap>
2359struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile> { using type = _Rp(_Ap...); };
2360
2361template<class _Rp, class _Gp, class ..._Ap>
2362struct __strip_signature<_Rp (_Gp::*) (_Ap...) &> { using type = _Rp(_Ap...); };
2363template<class _Rp, class _Gp, class ..._Ap>
2364struct __strip_signature<_Rp (_Gp::*) (_Ap...) const &> { using type = _Rp(_Ap...); };
2365template<class _Rp, class _Gp, class ..._Ap>
2366struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile &> { using type = _Rp(_Ap...); };
2367template<class _Rp, class _Gp, class ..._Ap>
2368struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile &> { using type = _Rp(_Ap...); };
2369
2370template<class _Rp, class _Gp, class ..._Ap>
2371struct __strip_signature<_Rp (_Gp::*) (_Ap...) noexcept> { using type = _Rp(_Ap...); };
2372template<class _Rp, class _Gp, class ..._Ap>
2373struct __strip_signature<_Rp (_Gp::*) (_Ap...) const noexcept> { using type = _Rp(_Ap...); };
2374template<class _Rp, class _Gp, class ..._Ap>
2375struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile noexcept> { using type = _Rp(_Ap...); };
2376template<class _Rp, class _Gp, class ..._Ap>
2377struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile noexcept> { using type = _Rp(_Ap...); };
2378
2379template<class _Rp, class _Gp, class ..._Ap>
2380struct __strip_signature<_Rp (_Gp::*) (_Ap...) & noexcept> { using type = _Rp(_Ap...); };
2381template<class _Rp, class _Gp, class ..._Ap>
2382struct __strip_signature<_Rp (_Gp::*) (_Ap...) const & noexcept> { using type = _Rp(_Ap...); };
2383template<class _Rp, class _Gp, class ..._Ap>
2384struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); };
2385template<class _Rp, class _Gp, class ..._Ap>
2386struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); };
2387
2388template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
2389function(_Fp) -> function<_Stripped>;
2390#endif // !_LIBCPP_HAS_NO_DEDUCTION_GUIDES
2391
2338template<class _Rp, class ..._ArgTypes>
2339function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}
2340
2341#if _LIBCPP_STD_VER <= 14
2342template<class _Rp, class ..._ArgTypes>
2343template <class _Alloc>
2344function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
2345 const function& __f) : __f_(__f.__f_) {}

--- 697 unchanged lines hidden ---
2392template<class _Rp, class ..._ArgTypes>
2393function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}
2394
2395#if _LIBCPP_STD_VER <= 14
2396template<class _Rp, class ..._ArgTypes>
2397template <class _Alloc>
2398function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
2399 const function& __f) : __f_(__f.__f_) {}

--- 697 unchanged lines hidden ---