From 5ffb89af936c7e2610a36256ebb98093b7767f93 Mon Sep 17 00:00:00 2001 From: Laptop Windows Date: Wed, 21 Feb 2024 23:54:11 -0500 Subject: [PATCH] uwu --- libs/BLT | 2 +- tests/src/tests.cpp | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/libs/BLT b/libs/BLT index 43cf8c0..89bde7c 160000 --- a/libs/BLT +++ b/libs/BLT @@ -1 +1 @@ -Subproject commit 43cf8c0ba1c151048679d0cfbeb6d82dab757a64 +Subproject commit 89bde7c6e85ab50de988fb3f7b91d2041b41a4cb diff --git a/tests/src/tests.cpp b/tests/src/tests.cpp index 157303e..93d9efe 100644 --- a/tests/src/tests.cpp +++ b/tests/src/tests.cpp @@ -140,15 +140,39 @@ namespace fb }; - template - struct operator_t + template + class arg_constraint_container + { + private: + blt::vector> map; + public: + template>>, bool> = true> + constexpr explicit arg_constraint_container(T&& map): map(std::forward(map)) + {} + + template>, bool> = true> + constexpr explicit arg_constraint_container(blt::size_t argc, T&& map) + { + for (blt::size_t i = 0; i < argc; i++) + this->map.push_back(map); + } + + constexpr arg_constraint_container(std::initializer_list> maps) + { + for (const auto& v : maps) + this->map.push_back(v); + } + }; + + template + class operator_t { private: arg_count_t argc; std::function)> func; - blt::vector> allowed_inputs; + arg_constraint_container allowed_inputs; public: - operator_t(arg_count_t argc, std::function)> func): argc(argc), func(std::move(func)) + constexpr operator_t(arg_count_t argc, std::function)> func): argc(argc), func(std::move(func)) {} [[nodiscard]] constexpr arg_count_t argCount() const @@ -156,8 +180,8 @@ namespace fb [[nodiscard]] constexpr std::function)> function() const { return func; } - - + + }; template