/** This file is a part of rexy's general purpose library Copyright (C) 2020 rexy712 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 REXY_TRAITS_HPP #define REXY_TRAITS_HPP #include //is_same, decay, integral_constant, declval #include "rexy.hpp" namespace rexy{ template struct is_type{ static std::true_type check(U*); static std::false_type check(...); static constexpr bool value = std::is_same*>()))>::value; }; template class U> struct is_template_type_helper{ static constexpr bool value = false; }; template class U, class... Args> struct is_template_type_helper,U>{ static constexpr bool value = true; }; template class U> struct is_template_type : public is_template_type_helper,U>{}; template class Tmpl> struct is_template_derived_type{ template static std::true_type test(Tmpl*); static std::false_type test(void*); static constexpr bool value = std::is_same*>(nullptr)))>::value; }; } #endif