cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
recursive_lambda.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_BASIC_RECURSIVE_LAMBDA_H
4#define pRC_CORE_BASIC_RECURSIVE_LAMBDA_H
5
7
8namespace pRC
9{
10 template<class L>
12 {
13 public:
16
17 template<class X>
19 constexpr RecursiveLambda(X &&lambda)
20 : mLambda(std::forward<X>(lambda))
21 {
22 }
23
24 template<auto... Ps, class... Xs>
25 constexpr decltype(auto) operator()(Xs &&...args) const
26 {
27 return mLambda.template operator()<Ps...>(*this,
28 forward<Xs>(args)...);
29 }
30
31 template<auto... Ps, class... Xs>
32 constexpr decltype(auto) operator()(Xs &&...args)
33 {
34 return mLambda.template operator()<Ps...>(*this,
35 forward<Xs>(args)...);
36 }
37
38 private:
39 L mLambda;
40 };
41
42 template<class X>
44}
45#endif // pRC_CORE_BASIC_RECURSIVE_LAMBDA_H
Definition recursive_lambda.hpp:12
RecursiveLambda & operator=(RecursiveLambda const &)=delete
RecursiveLambda(RecursiveLambda const &)=delete
constexpr RecursiveLambda(X &&lambda)
Definition recursive_lambda.hpp:19
Definition concepts.hpp:37
Definition cholesky.hpp:10
RecursiveLambda(X &&) -> RecursiveLambda< RemoveReference< X > >
Definition common.hpp:10