Skip to content

Commit deb4bdc

Browse files
committed
Merge branch 'v2' into boost-master
2 parents 0dfd495 + 4b310e2 commit deb4bdc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2831
-3221
lines changed

dev/clang-format-all

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
find include src examples tests docs.in -type f -name "*.?pp" | xargs clang-format -i

dev/presetgen

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ presets = {
5252
"YOMM2_ENABLE_EXAMPLES": "ON",
5353
"YOMM2_ENABLE_TESTS": "ON",
5454
"YOMM2_ENABLE_BENCHMARKS": "ON",
55-
"YOMM2_SHARED": "ON" if linkage == "shared" else "OFF",
5655
},
5756
**tool_chain.configure_presets,
5857
}

docs.in/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ The header itself does not define any macros, except for its include guard
100100
The header consumes three macros:
101101
* `NDEBUG`: if defined, no checks are performed during method calls. This
102102
delivers a performance close to normal virtual function calls.
103-
* `YOMM2_SHARED`: if defined, the library runtime is in a shared library or DLL.
104103
* ->`YOMM2_DEFAULT_POLICY`: if defined, overrides the default policy.
105104

106105
The header defines the following macros:

docs.in/reference/apply_product.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ the n-fold Cartesian product of the input `mp_list` lists.
2626
#include <yorel/yomm2/templates.hpp>
2727

2828
using namespace yorel::yomm2;
29-
using boost::mp11::mp_list;
29+
using detail::types;
3030

3131
struct a;
3232
struct b;
@@ -41,10 +41,10 @@ static_assert(
4141
std::is_same_v<
4242
apply_product<
4343
templates<bin1, bin2>,
44-
mp_list<a, b>,
45-
mp_list<x, y, z>
44+
types<a, b>,
45+
types<x, y, z>
4646
>,
47-
mp_list<
47+
types<
4848
bin1<a, x>, bin1<a, y>, bin1<a, z>,
4949
bin1<b, x>, bin1<b, y>, bin1<b, z>,
5050

docs.in/reference/policy-vptr_placement.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ as parameters in multi-methods.
121121
#include <malloc.h>
122122

123123
namespace std {
124-
void* aligned_alloc(size_t alignment, size_t size) {
124+
void* aligned_alloc(std::size_t alignment, std::size_t size) {
125125
return _aligned_malloc(size, alignment);
126126
}
127127
} // namespace std
@@ -168,7 +168,7 @@ struct number_aware_policy : default_static::replace<vptr_placement, vptr_page>
168168
template<class T>
169169
class Page {
170170
private:
171-
static constexpr size_t page_size = 1024;
171+
static constexpr std::size_t page_size = 1024;
172172
char* base;
173173
T* top;
174174

@@ -179,7 +179,7 @@ class Page {
179179
*reinterpret_cast<std::uintptr_t**>(base) =
180180
number_aware_policy::static_vptr<T>;
181181
void* first = base + sizeof(std::uintptr_t*);
182-
size_t space = page_size - sizeof(std::uintptr_t*);
182+
std::size_t space = page_size - sizeof(std::uintptr_t*);
183183
std::align(alignof(T), sizeof(T), first, space);
184184
top = reinterpret_cast<T*>(first);
185185
}

docs.in/reference/product.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ headers:yorel/yomm2/templates.hpp>
66
template<typename... TypeLists>
77
using product = /*unspecified*/;
88
```
9-
`product` takes a list of ->mp_list lists, and evaluates to a `mp_list` list
9+
`product` takes a list of ->types lists, and evaluates to a `types` list
1010
consisting of the n-fold Cartesian product of the input lists.
1111

1212
## Example
@@ -19,11 +19,9 @@ consisting of the n-fold Cartesian product of the input lists.
1919

2020
#include <type_traits>
2121
#include <yorel/yomm2/core.hpp>
22-
#include <yorel/yomm2/compiler.hpp>
2322
#include <yorel/yomm2/templates.hpp>
2423

2524
namespace yomm2 = yorel::yomm2;
26-
using boost::mp11::mp_list;
2725

2826
struct a;
2927
struct b;
@@ -34,12 +32,12 @@ struct z;
3432
static_assert(
3533
std::is_same_v<
3634
yomm2::product<
37-
mp_list<a, b>,
38-
mp_list<x, y, z>
35+
yomm2::types<a, b>,
36+
yomm2::types<x, y, z>
3937
>,
40-
mp_list<
41-
mp_list<a, x>, mp_list<a, y>, mp_list<a, z>,
42-
mp_list<b, x>, mp_list<b, y>, mp_list<b, z>
38+
yomm2::types<
39+
yomm2::types<a, x>, yomm2::types<a, y>, yomm2::types<a, z>,
40+
yomm2::types<b, x>, yomm2::types<b, y>, yomm2::types<b, z>
4341
>
4442
>);
4543

docs.in/tutorials/custom_rtti_tutorial.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ It provides the following static member functions:
5050
Writes a representation of `type` to `stream`. Used to format error
5151
messages, and by `update` if trace is enabled. `Stream` is a lighweight
5252
version of `std::ostream` with reduced functionality. It only supports
53-
insertion of `const char*`, `std::string_view`, pointers and `size_t`. This
53+
insertion of `const char*`, `std::string_view`, pointers and `std::size_t`. This
5454
function is optional; if not provided, "type_id(_type_)" is used.
5555
5656
* `static (unspecified) type_index(type_id type);`<br>
@@ -321,26 +321,26 @@ namespace no_projection {
321321
//***
322322

323323
struct Animal {
324-
Animal(const char* name, size_t type) : name(name), type(type) {
324+
Animal(const char* name, std::size_t type) : name(name), type(type) {
325325
}
326326

327327
const char* name;
328-
size_t type;
329-
static constexpr size_t static_type = 1;
328+
std::size_t type;
329+
static constexpr std::size_t static_type = 1;
330330
};
331331

332332
struct Dog : Animal {
333-
Dog(const char* name, size_t type = static_type) : Animal(name, type) {
333+
Dog(const char* name, std::size_t type = static_type) : Animal(name, type) {
334334
}
335335

336-
static constexpr size_t static_type = 2;
336+
static constexpr std::size_t static_type = 2;
337337
};
338338

339339
struct Cat : Animal {
340-
Cat(const char* name, size_t type = static_type) : Animal(name, type) {
340+
Cat(const char* name, std::size_t type = static_type) : Animal(name, type) {
341341
}
342342

343-
static constexpr size_t static_type = 3;
343+
static constexpr std::size_t static_type = 3;
344344
};
345345

346346
//***
@@ -465,35 +465,35 @@ namespace defered_type_id {
465465
//***
466466

467467
struct Animal {
468-
Animal(const char* name, size_t type) : name(name), type(type) {
468+
Animal(const char* name, std::size_t type) : name(name), type(type) {
469469
}
470470

471471
const char* name;
472-
static size_t last_type_id;
473-
static size_t static_type;
474-
size_t type;
472+
static std::size_t last_type_id;
473+
static std::size_t static_type;
474+
std::size_t type;
475475
};
476476

477-
size_t Animal::last_type_id;
478-
size_t Animal::static_type = ++Animal::last_type_id;
477+
std::size_t Animal::last_type_id;
478+
std::size_t Animal::static_type = ++Animal::last_type_id;
479479

480480
struct Dog : Animal {
481-
Dog(const char* name, size_t type = static_type) : Animal(name, type) {
481+
Dog(const char* name, std::size_t type = static_type) : Animal(name, type) {
482482
}
483483

484-
static size_t static_type;
484+
static std::size_t static_type;
485485
};
486486

487-
size_t Dog::static_type = ++Animal::last_type_id;
487+
std::size_t Dog::static_type = ++Animal::last_type_id;
488488

489489
struct Cat : Animal {
490-
Cat(const char* name, size_t type = static_type) : Animal(name, type) {
490+
Cat(const char* name, std::size_t type = static_type) : Animal(name, type) {
491491
}
492492

493-
static size_t static_type;
493+
static std::size_t static_type;
494494
};
495495

496-
size_t Cat::static_type = ++Animal::last_type_id;
496+
std::size_t Cat::static_type = ++Animal::last_type_id;
497497

498498
//***
499499

0 commit comments

Comments
 (0)