FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
constexpr-sql/include/ra/projection.hpp at master · mkitzan/constexpr-sql · GitHub
mkitzan
/
constexpr-sql
Public
Notifications
You must be signed in to change notification settings
Fork
7
Star
142
Code
Issues
2
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
constexpr-sql
/
include
/
ra
/
projection.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (35 loc) · 879 Bytes
Breadcrumbs
constexpr-sql
/
include
/
ra
/
projection.hpp
Copy path
File metadata and controls
45 lines (35 loc) · 879 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
pragma
once
#
include
"
ra/operation.hpp
"
#
include
"
sql/row.hpp
"
namespace
ra
{
template
<
typename
Output,
typename
Input>
class
projection
:
public
ra
::unary<Input>
{
using
input_type =
typename
ra::unary<Input>::input_type;
public:
using
output_type = Output;
static
auto
&& next()
{
fold<output_type>(output_row,
Input::next
());
return
std::move
(output_row);
}
private:
template
<
typename
Dest>
static
inline
constexpr
void
fold
(Dest& dest, input_type
const
& src)
{
if
constexpr
(Dest::depth ==
0
)
{
return
;
}
else
{
dest.
head
() = sql::get<Dest::column::name>(src);
fold<
typename
Dest::next>(dest.
tail
(), src);
}
}
static
output_type output_row;
};
template
<
typename
Output,
typename
Input>
typename
projection<Output, Input>::output_type projection<Output, Input>::output_row{};
}
//
namespace ra
Back
|
FazBrowse Home
|
New Git URL