Skip to content

Commit a8c042b

Browse files
committed
feat(functional-programming)
1 parent 5e9b92a commit a8c042b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

include/stdsharp/functional/fp.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#pragma once
2+
3+
#include "invocables.h"
4+
5+
#include "../compilation_config_in.h"
6+
7+
namespace stdsharp::fp
8+
{
9+
template<typename... Fn>
10+
class function
11+
{
12+
private:
13+
invocables<Fn...> fn_;
14+
15+
template<std::size_t Layer, typename... Args>
16+
constexpr decltype(auto) impl(Args&&... args) const
17+
{
18+
return invoke_at<Layer>(fn_, cpp_forward(args)...);
19+
}
20+
};
21+
}
22+
23+
#include "../compilation_config_out.h"

include/stdsharp/type_traits/indexed_traits.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// TODO: __cpp_pack_indexing >= 202311L
2+
13
#pragma once
24

35
#include "core_traits.h"

0 commit comments

Comments
 (0)