cMHN 1.1
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, If<IsConstructible<L, X>> = 0>
18 constexpr RecursiveLambda(X &&lambda)
19 : mLambda(std::forward<X>(lambda))
20 {
21 }
22
23 template<auto... Ps, class... Xs>
24 constexpr decltype(auto) operator()(Xs &&...args) const
25 {
26 return mLambda.template operator()<Ps...>(*this,
27 forward<Xs>(args)...);
28 }
29
30 template<auto... Ps, class... Xs>
31 constexpr decltype(auto) operator()(Xs &&...args)
32 {
33 return mLambda.template operator()<Ps...>(*this,
34 forward<Xs>(args)...);
35 }
36
37 private:
38 L mLambda;
39 };
40
41 template<class X>
43}
44#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:18
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
RecursiveLambda(X &&) -> RecursiveLambda< RemoveReference< X > >