Skip to content

Commit 82bbbb5

Browse files
committed
Merge branch 'main' of https://github.com/userexit/dandy
2 parents f5d6d30 + 80cea25 commit 82bbbb5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@
1414

1515
---
1616

17+
## Table of contents
18+
19+
* [Types](#types)
20+
* [Basic usage](#basic-usage)
21+
* [Operators](#operators)
22+
* [Construction](#construction)
23+
* [Expression templates](#expression-templates)
24+
* [Indexing](#indexing)
25+
* [Functions](#functions)
26+
* [STL integration](#stl-integration)
27+
* [Options](#options)
28+
* [User defined conversions](#user-defined-conversions)
29+
* [Metafunctions](#metafunctions)
30+
1731
## Types
1832

1933
The generic vector template is defined as `vector<[scalar type], [size]>` in namespace `dd`. For convenience, vectors sizes 2-4 have aliases of the form `[scalar type][size]d` in the `dd::types` namespace:
@@ -222,3 +236,24 @@ struct dd::converter<dd::vector<S1, 2>, some_vector<S2>>
222236
}
223237
};
224238
```
239+
240+
## Metafunctions
241+
242+
NOTES:
243+
* these are included in the documentation only for posterity and are not expected to be of use to the user
244+
* all metafunctions are under the namespace `dd::traits`
245+
* all metafunctions have corresponding `_t` or `_v` postfix helpers
246+
* for brevity, `value` serves as an alias for `std::integral_constant`
247+
248+
| Function | Description |
249+
| --- | --- |
250+
| `size<T>` -> `value<size_t>` | gets the vector size of expression `T` |
251+
| `scalar<T>` -> `type` | gets the scalar type of expression `T` |
252+
| `result<T>` -> `type` | gets the resulting vector value of expression `T` |
253+
| `is_expr<T>` -> `value<bool>` | determines if `T` is a vector expression |
254+
| `is_same_size<T, U>` -> `value<bool>` | determines if `T` and `U` are both expressions of the same size |
255+
| `is_valid_operation<T, U, bool S>` -> `value<bool>` | determines if `T` and `U` make up a valid operation. `S = true` forbids a scalar type from appearing first |
256+
| `is_value<T>` -> `value<bool>` | determines if `T` is a value expression |
257+
| `has_named_components<T>` -> `value<bool>` | determines if T has named components |
258+
| `has_converter<T, U>` -> `value<bool>` | determines if there is a `converter` specialization defined from `T` to `U` |
259+

0 commit comments

Comments
 (0)