No description
Find a file
2024-07-15 17:45:11 +00:00
cmake Fix cmake package 2024-03-24 20:09:25 +00:00
examples/src Add void to Switch 2024-07-15 16:17:00 +00:00
include/utempl Add call def if not found and def not default value 2024-07-15 17:45:11 +00:00
tests Add menu test, fix namespaces 2024-02-27 22:39:08 +00:00
.clang-format Add .clang-format, .clang-tidy and fixes 2024-07-04 14:17:21 +00:00
.clang-tidy Add .clang-format, .clang-tidy and fixes 2024-07-04 14:17:21 +00:00
CMakeLists.txt C++20 -> C++23 and add Switch 2024-07-15 13:54:41 +00:00
LICENSE Initial commit 2024-02-22 15:12:35 +00:00
README.md Update README.md 2024-04-18 23:40:12 +00:00

uTempl - Modern C++ Template Library

Features

Ranges Like Interface For TupleLike

#include <utempl/utils.hpp>

auto main() -> int {
  using namespace utempl;
  constexpr 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

#include <utempl/meta_info.hpp>
#include <array>
#include <type_traits>

auto main() -> int {
  using namespace utempl;
  constexpr std::array types{kTypeId<int>, kTypeId<void>};
  static_assert(std::is_same_v<GetMetaInfo<types[0]>::Type, int>);
  static_assert(std::is_same_v<GetMetaInfo<types[1]>::Type, void>);
  static_assert(std::is_same_v<decltype(GetTypeListForTag()), TypeList<int, void>>);
};

License

This project is licensed under the MIT License - see the LICENSE file for details.