From 4abca0d61364f4ac8e66a883daf5eba7b42383d9 Mon Sep 17 00:00:00 2001 From: slowy07 Date: Thu, 1 Aug 2024 08:57:07 +0700 Subject: [PATCH] chore: update traits following clara state Signed-off-by: slowy07 --- include/traits.hpp | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 include/traits.hpp diff --git a/include/traits.hpp b/include/traits.hpp new file mode 100644 index 0000000..766f8d9 --- /dev/null +++ b/include/traits.hpp @@ -0,0 +1,93 @@ +// Copyright (c) 2023 arfy slowy + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + +#ifndef CLARA_TRAITS_HPP_ +#define CLARA_TRAITS_HPP_ + +#include +#include +#include +namespace clara { +template +struct make_void { + typedef void type; +}; + +template +using to_void = typename make_void::type; + +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Weffc++" +#endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 0) && !__clang__) + +template +struct is_iterable : std::false_type {}; + +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic pop +#endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) + +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Weffc++" +#endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +template +struct is_iterable().begin()), decltype(std::declval().end()), + decltype(*(std::declval().begin()))>> : std::true_type {}; +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic pop +#endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) + +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Weffc++" +#endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +template +struct is_matrix_expression : std::is_base_of::type>, + typename std::decay::type> {}; +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic pop +#endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) + +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Weffc++" +#endif +template +struct is_complex : std::false_type {}; +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic pop +#endif + +#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Weffc++" +#endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && !__clang__) + +template +struct is_complex> : std::true_type {}; +#if ((__GNUC__) && (__GNUC_MINOR__ == 8) && !__clang__) +#pragma GCC diagnostic pop +#endif // ((__GNUC__) && (__GNUC_MINOR__ == 8) && !__clang__) + +} // namespace clara + +#endif // !CLARA_TRAITS_HPP_