From 4de3aeb87c78a13f8e493e48477220084610c076 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Wed, 10 Jul 2024 20:41:26 -0400 Subject: [PATCH] meta --- CMakeLists.txt | 2 +- include/blt/std/meta.h | 62 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 include/blt/std/meta.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 61ec34c..64da85d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.18.3) +set(BLT_VERSION 0.18.4) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/std/meta.h b/include/blt/std/meta.h new file mode 100644 index 0000000..cf2904e --- /dev/null +++ b/include/blt/std/meta.h @@ -0,0 +1,62 @@ +#pragma once +/* + * Copyright (C) 2024 Brett Terpstra + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef BLT_META_H +#define BLT_META_H + +#include +#include + +namespace blt::meta +{ + template + struct arg_helper + { + using First = IFirst; + using Next = arg_helper; + }; + + template<> + struct arg_helper + { + using First = void; + using Next = void; + }; + + template + struct lambda_helper + { + using Lambda = TheLambda; + }; + + template + struct lambda_helper + { + using Lambda = TheLambda; + using Return = IReturn; + using Class = IClass; + using Args = arg_helper; + }; + + template + lambda_helper(Lambda) -> lambda_helper; + + +} + +#endif //BLT_GP_META_H