Repository is at https://gitlab.fi.muni.cz/xkoniar/emlabcpp and mirrored to github repository https://github.com/emlab-fi/emlabcpp.
...
...
@@ -63,6 +65,8 @@ auto iter = find_if(vec_data, [&]( int i ){
```
See examples for an overview of algorithms.
### either.h
`either<A,B>` is `std::variant` alternative able to hold only two types.
...
...
@@ -130,6 +134,46 @@ for(int i : reversed(vec_data))
std::cout<<'\n';
```
### bounded.h
Simple overlay type for constraing value within specified range.
Makes it possible to create clear API that does not have to check the sanity of values.
`bounded<int,0,42>` means that the `bounded` class contains `int` type that is constrained within `0` and `42`.
The API with `bounded` has more clear intent:
```cpp
voidfoo(bounded<int,0,42>);
```
### protocol.h
The protocol library serializes and deserialize C++ data structures into binary messages.
The principle is that the protocol is defined with library types.
Based on the definition, `protocol_handler<Def>` provides routines for serialization and deserialization of data structures corresponding to said definition.
In case of work with simple robot, we can create simple protocol: