forked from hsutter/cppfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpure2-is-with-free-functions-predicate.cpp
More file actions
68 lines (47 loc) · 1.97 KB
/
pure2-is-with-free-functions-predicate.cpp
File metadata and controls
68 lines (47 loc) · 1.97 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#define CPP2_INCLUDE_STD Yes
//=== Cpp2 type declarations ====================================================
#include "cpp2util.h"
#line 1 "pure2-is-with-free-functions-predicate.cpp2"
//=== Cpp2 type definitions and function declarations ===========================
#line 1 "pure2-is-with-free-functions-predicate.cpp2"
auto fun(auto const& v) -> void;
#line 15 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto main() -> int;
#line 21 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto pred_i(cpp2::impl::in<int> x) -> bool;
#line 25 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto pred_d(cpp2::impl::in<double> x) -> bool;
#line 29 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto pred_(auto const& x) -> bool;
//=== Cpp2 function definitions =================================================
#line 1 "pure2-is-with-free-functions-predicate.cpp2"
auto fun(auto const& v) -> void{
#line 2 "pure2-is-with-free-functions-predicate.cpp2"
if (cpp2::impl::is(v, (pred_i))) {
std::cout << "" + cpp2::to_string(v) + " is integer bigger than 3" << std::endl;
}
if (cpp2::impl::is(v, (pred_d))) {
std::cout << "" + cpp2::to_string(v) + " is double bigger than 3" << std::endl;
}
if (cpp2::impl::is(v, (pred_))) {
std::cout << "" + cpp2::to_string(v) + " is bigger than 3" << std::endl;
}
}
#line 15 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto main() -> int{
fun(3.14);
fun(42);
fun('a');
}
#line 21 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto pred_i(cpp2::impl::in<int> x) -> bool{
return cpp2::impl::cmp_greater(x,3);
}
#line 25 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto pred_d(cpp2::impl::in<double> x) -> bool{
return cpp2::impl::cmp_greater(x,3);
}
#line 29 "pure2-is-with-free-functions-predicate.cpp2"
[[nodiscard]] auto pred_(auto const& x) -> bool{
return cpp2::impl::cmp_greater(x,3);
}