summaryrefslogtreecommitdiff
path: root/core/test_propcomp_cpp-speed.cpp
blob: ab9e4ba3072daf9311f493345cc20ccecfce9bc1 (plain)
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
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_LIST_SIZE 50

#include <iostream>

#include <boost/mpl/pair.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mpl/bool.hpp>

#include "continuous_property.hpp"
#include "pla_debug_name.hpp"
#include "property_composition.hpp"

#include "mempool.hpp"

// create some extra properties
#define A1(t, s) GEN_CP(Global, t, s, int, 0);
#define A2(t, s) A1(t ## 0, s "0") A1(t ## 1, s "1")
#define A4(t, s) A2(t ## 0, s "0") A2(t ## 1, s "1")
#define A8(t, s) A4(t ## 0, s "0") A4(t ## 1, s "1")
#define A16(t, s) A8(t ## 0, s "0") A8(t ## 1, s "1")
#define A32(t, s) A16(t ## 0, s "0") A16(t ## 1, s "1")
#define A64(t, s) A32(t ## 0, s "0") A32(t ## 1, s "1")
#define A128(t, s) A64(t ## 0, s "0") A64(t ## 1, s "1")

#define B1(t) boost::mpl::pair<t, boost::mpl::bool_<false>>
#define B2(t) B1(t ## 0), B1(t ## 1)
#define B4(t) B2(t ## 0), B2(t ## 1)
#define B8(t) B4(t ## 0), B4(t ## 1)
#define B16(t) B8(t ## 0), B8(t ## 1)
#define B32(t) B16(t ## 0), B16(t ## 1)
#define B64(t) B32(t ## 0), B32(t ## 1)
#define B128(t) B64(t ## 0), B64(t ## 1)

#define B48(t) B32(t ## 0), B16(t ## 1 ## 1)

A64(Many, "many")

int main() {
  // below is bullshit
  PropertyComposition<
    boost::mpl::list<
      B48(Many) // work around boost::mpl::list limit of 50 elements
  >> test1;

  PLA_Debug_Name action_debug;
  std::cout << *test1.call(action_debug) << std::endl;
}
contact: Jan Huwald // Impressum