File tree Expand file tree Collapse file tree 6 files changed +12
-25
lines changed Expand file tree Collapse file tree 6 files changed +12
-25
lines changed Original file line number Diff line number Diff line change 1
- all : fib gcd list conditional church
2
-
3
- church : church.cpp church.hpp
4
- $(CXX ) -o $@ $<
5
-
6
- conditional : conditional.cpp conditional.hpp
7
- $(CXX ) -o $@ $<
1
+ CXXFLAGS += -Wextra -Wall -pedantic
8
2
9
- list : list.cpp list.hpp
10
- $(CXX ) -o $@ $<
11
-
12
- fib : fib.cpp fib.hpp
13
- $(CXX ) -o $@ $<
14
-
15
- gcd : gcd.cpp gcd.hpp
16
- $(CXX ) -o $@ $<
3
+ all : fib gcd list conditional church
17
4
18
5
.PHONY : clean
19
- clean :
6
+ clean :
20
7
-rm -rf fib * .o gcd list conditional church
Original file line number Diff line number Diff line change 1
1
This is a collection of test programs that play around with C++ template metaprogramming.
2
2
3
3
Most of the interesting stuff is in list.{c,h}pp
4
- In there is a LIST datastructure that can generate compile time lists of ints
4
+ In there is a LIST data structure that can generate compile time lists of ints
5
5
(stored in typedefs) over which computations or code can be generated at
6
- compile time. The coolest example in there is the compile time mergesort .
6
+ compile time. The coolest example in there is the compile time merge-sort .
7
7
8
8
There is the start of some church encoding experiments in church.{c,h}pp
9
9
10
- There is a basic compile time fibonacci generator in fib.{c,h}pp
10
+ There is a basic compile time Fibonacci generator in fib.{c,h}pp
11
11
12
12
There is a compile time GCD calculator in gcd.{c,h}pp
13
13
Original file line number Diff line number Diff line change @@ -10,18 +10,18 @@ struct B {
10
10
};
11
11
12
12
struct A1 {
13
- static inline int EXEC (void ) {
13
+ static inline void EXEC (void ) {
14
14
std::cout << " TRUE!" ;
15
15
}
16
16
};
17
17
18
18
struct B1 {
19
- static inline int EXEC (void ) {
19
+ static inline void EXEC (void ) {
20
20
std::cout << " FALSE!" ;
21
21
}
22
22
};
23
23
24
- int main (int argc, char **argv ) {
24
+ int main () {
25
25
std::cout << " true = " << IF<true , A, B>::TEST::RESULT << std::endl;
26
26
std::cout << " true = " << IF<false , A, B>::TEST::RESULT << std::endl;
27
27
Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
#include " fib.hpp"
3
3
4
- int main (int argc, char **argv ) {
4
+ int main () {
5
5
std::cout << " Fib 5:" << FIB<5 >::RESULT << std::endl;
6
6
}
Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
#include " gcd.hpp"
3
3
4
- int main (int argc, char **argv ) {
4
+ int main () {
5
5
std::cout << " GCD (25,50) == " << GCD<25 , 50 >::RESULT << std::endl;
6
6
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ template <int a, int b> struct ORD {
32
32
static const bool VALUE = a < b;
33
33
};
34
34
35
- int main (int argc, char **argv ) {
35
+ int main () {
36
36
37
37
/* The best example */
38
38
std::cout << " The list is: " ;
You can’t perform that action at this time.
0 commit comments