-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreadme.txt
91 lines (68 loc) · 3.08 KB
/
readme.txt
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
clause
What this is all about
----------------------
'clause' is a C++ metaprogramming library licensed under the Mozilla Public
License 2.0. The following is the current list of its sublibrary components.
* ppmpf (preprocessor metaprogramming framework)
* ample (another metaprogramming library etude)
There are no third party library dependencies other than very minimal C++14
standard library support (to almost none) for using this library. However, it
is very important that you use a fully C++14 compliant compiler. Library is
transitioning in an "unstable" manner, build system will provide hints.
Check development branches like `ampl2-dev` for edge, unstable features.
An example of how parameter packs can be manipulated for several uses
through operator driven semantics in development so far:
#include <clause/ample/base/atpp.hh>
#include <type_traits> // for std::is_same
// T... must be between 0 and 20 types in size while
// consisting of a repeating pattern of its first half;
// repeat it 8 times and instantiate a Super<...> class
// template with type indexes 1,3,5,0,0,7 then create
// a pack from of indices [3,5) of the resulting pack.
// Stranger things can happen.
template<typename...>
struct test{};
template<typename... T>
auto example1(T...)
-> templify((test) ( (T...){0,20}[2]^8)(1,3,5,0,0,7)
>>= {3,5} );
int main() {
// notice alternation of int/double
return std::is_same<
decltype(example1(1,2.3,3,4.3,5,6.5,7,8.6))
, test<int,int>
>::value;
}
Testing the code available
--------------------------
Tests are provided for clause using its own testing framework, which itself is
pretty much a work in progress. New tests are added regularly and they are used
in order to ascertain proper library functionality.
If you wish to just run the tests available for clause, simply clone the git
repository and run make as follows in your terminal:
git clone git://github.com/irrequietus/clause.git
cd clause
./autogen.sh
./configure
make test
If you wish to get ANSI coloured output for the tests, do the following
variation of the previously mentioned commands in your terminal:
git clone git://github.com/irrequietus/clause.git
cd clause
./autogen.sh
./configure --enable-ansi-colors
make test
It is now possible to use --with-compiler=<compiler path here> to specify
a particular compiler path to be used during make targets. The 'make test'
command adds a '-DUSE_TEST_EXPANSION' to the flags using during tests, allowing
for test macro expansion to occur only during tests.
In order to run compile and run a single test within the subdirectories for
ample and / or ppmpf, after properly configuring the package as above run
something like the example below, properly substituting "testname1" and
"testname2":
make just ample/testname1.cc
make just ppmpf/testname2.cc
This will result in just compiling and running the test you are interested in.
Reporting bugs and other issues
-------------------------------
Please report any issues over at https://github.com/irrequietus/clause/issues