From c8be3247da41695f5aa0ab67c376c638044c2fc1 Mon Sep 17 00:00:00 2001 From: sha512sum Date: Thu, 28 Mar 2024 19:24:30 +0000 Subject: [PATCH] Update README.md --- README.md | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0c3ce01..74cff27 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,34 @@ # uTempl - Modern C++ Template Library ## Features -- TypeList: List of types and functions for working with them -- GoInterface: Go-like interfaces for C++ -- ConstexprString: A template for working with compile-time strings using constexpr. -- Tuple Realization: Implementation of tuples in a modern C++ way. -- 🔥Blazing🔥 Fast Menu Builder🚀🚀🚀: Quickly build interactive menus in your terminal applications. -- Overloaded +### Ranges Like Interface For TupleLike +```cpp +#include + +auto main() -> int { + using namespace utempl; + TupleLike auto tuple = Tuple{1, 2, 3, 4, 5, 6} + | Take<5>() + | Map([](int arg){return arg + 1;}) + | Map([](int arg) -> float {return arg;}) + | Reverse() + | Take<3>(); // Lazy evaluate + static_assert(tuple == Tuple{6.0f, 5.0f, 4.0f}); +}; +``` +### Storage types in array +```cpp +#include +#include +#include + +auto main() -> int { + using namespace utempl; + constexpr std::array types{kTypeId, kTypeId}; + static_assert(std::is_same_v::Type, int>); + static_assert(std::is_same_v::Type, void>); +}; +``` ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.