mirror of
https://github.com/BlackMATov/kari.hpp.git
synced 2025-12-16 16:07:08 +07:00
update README (add pipe operator example, new wandbox link)
This commit is contained in:
16
README.md
16
README.md
@@ -18,7 +18,7 @@
|
||||
[appveyor]: https://ci.appveyor.com/project/BlackMATov/kari-hpp
|
||||
[license]: https://github.com/BlackMATov/kari.hpp/blob/master/LICENSE.md
|
||||
[godbolt]: https://godbolt.org/g/XPBgjY
|
||||
[wandbox]: https://wandbox.org/permlink/l2PeuYUx2K2Yqbwj
|
||||
[wandbox]: https://wandbox.org/permlink/eKfLeyjXvOLfzQvG
|
||||
|
||||
[kari]: https://github.com/BlackMATov/kari.hpp
|
||||
|
||||
@@ -209,6 +209,20 @@ std::transform(v.begin(), v.end(), v.begin(), -_);
|
||||
|
||||
### Function composition
|
||||
|
||||
#### Pipe operator
|
||||
|
||||
```cpp
|
||||
using namespace kari::underscore;
|
||||
|
||||
auto r0 = (_*2) | (_+2) | 4; // (4 * 2) + 2 = 10
|
||||
auto r1 = 4 | (_*2) | (_+2); // (4 * 2 + 2) = 10
|
||||
|
||||
// output: 10,10
|
||||
std::cout << r0, << "," << r1 << std::endl;
|
||||
```
|
||||
|
||||
#### Compose operator
|
||||
|
||||
```cpp
|
||||
using namespace kari::underscore;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user