mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2026-09-30 17:43:09 +07:00
move type_kinds from base to detail
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#include "meta_binds/scope_bind.hpp"
|
||||
#include "meta_binds/void_bind.hpp"
|
||||
|
||||
#include "meta_concepts.hpp"
|
||||
#include "meta_details.hpp"
|
||||
|
||||
#include "meta_indices.hpp"
|
||||
#include "meta_indices/argument_index.hpp"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "meta_base/overloaded.hpp"
|
||||
#include "meta_base/select_overload.hpp"
|
||||
#include "meta_base/to_underlying.hpp"
|
||||
#include "meta_base/type_kinds.hpp"
|
||||
#include "meta_base/type_list.hpp"
|
||||
|
||||
namespace meta_hpp
|
||||
@@ -41,7 +40,6 @@ namespace meta_hpp
|
||||
using detail::select_non_const;
|
||||
using detail::select_overload;
|
||||
|
||||
using detail::type_kind;
|
||||
using detail::type_list;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
#include "meta_concepts.hpp"
|
||||
#include "meta_details.hpp"
|
||||
#include "meta_registry.hpp"
|
||||
#include "meta_states.hpp"
|
||||
#include "meta_types.hpp"
|
||||
@@ -92,10 +92,10 @@ namespace meta_hpp
|
||||
template < function_pointer_kind Function, typename... Opts >
|
||||
class_bind& function_(std::string name, Function function_ptr, Opts&&... opts);
|
||||
|
||||
template < class_member_kind<Class> Member, typename... Opts >
|
||||
template < class_member_pointer_kind<Class> Member, typename... Opts >
|
||||
class_bind& member_(std::string name, Member member_ptr, Opts&&... opts);
|
||||
|
||||
template < class_method_kind<Class> Method, typename... Opts >
|
||||
template < class_method_pointer_kind<Class> Method, typename... Opts >
|
||||
class_bind& method_(std::string name, Method method_ptr, Opts&&... opts);
|
||||
|
||||
template < typename Type >
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace meta_hpp
|
||||
}
|
||||
|
||||
template < class_kind Class >
|
||||
template < class_member_kind<Class> Member, typename... Opts >
|
||||
template < class_member_pointer_kind<Class> Member, typename... Opts >
|
||||
class_bind<Class>& class_bind<Class>::member_(std::string name, Member member_ptr, Opts&&... opts) {
|
||||
using namespace detail;
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace meta_hpp
|
||||
}
|
||||
|
||||
template < class_kind Class >
|
||||
template < class_method_kind<Class> Method, typename... Opts >
|
||||
template < class_method_pointer_kind<Class> Method, typename... Opts >
|
||||
class_bind<Class>& class_bind<Class>::method_(std::string name, Method method_ptr, Opts&&... opts) {
|
||||
using namespace detail;
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "https://github.com/blackmatov/meta.hpp"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2021-2024, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
|
||||
#include "meta_detail/type_family.hpp"
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
using detail::array_kind;
|
||||
using detail::class_kind;
|
||||
using detail::enum_kind;
|
||||
using detail::function_kind;
|
||||
using detail::function_pointer_kind;
|
||||
using detail::member_pointer_kind;
|
||||
using detail::method_pointer_kind;
|
||||
using detail::nullptr_kind;
|
||||
using detail::number_kind;
|
||||
using detail::pointer_kind;
|
||||
using detail::reference_kind;
|
||||
using detail::void_kind;
|
||||
|
||||
using detail::any_pointer_family;
|
||||
using detail::not_any_pointer_family;
|
||||
}
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
template < typename Class, typename... Args >
|
||||
concept class_constructor_kind //
|
||||
= class_kind<Class> //
|
||||
&& std::is_constructible_v<Class, Args...>; //
|
||||
|
||||
template < typename Class >
|
||||
concept class_destructor_kind //
|
||||
= class_kind<Class> && std::is_destructible_v<Class>; //
|
||||
|
||||
template < typename Member, typename Class >
|
||||
concept class_member_kind //
|
||||
= member_pointer_kind<Member> && class_kind<Class> //
|
||||
&& std::is_same_v<Class, typename detail::member_traits<Member>::class_type>; //
|
||||
|
||||
template < typename Method, typename Class >
|
||||
concept class_method_kind //
|
||||
= method_pointer_kind<Method> && class_kind<Class> //
|
||||
&& std::is_same_v<Class, typename detail::method_traits<Method>::class_type>; //
|
||||
}
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../meta_base.hpp"
|
||||
|
||||
#include "type_kinds.hpp"
|
||||
|
||||
#include "type_traits/array_traits.hpp"
|
||||
#include "type_traits/class_traits.hpp"
|
||||
#include "type_traits/constructor_traits.hpp"
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "base.hpp"
|
||||
#include "../meta_base.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "../meta_base.hpp"
|
||||
|
||||
#include "type_family.hpp"
|
||||
#include "type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class array_flags : std::uint32_t {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class class_flags : std::uint32_t {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class constructor_flags : std::uint32_t {
|
||||
@@ -18,6 +20,16 @@ namespace meta_hpp::detail
|
||||
META_HPP_DETAIL_BITFLAGS_OPERATORS_DECL(constructor_flags)
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < class_kind Class, typename... Args >
|
||||
struct constructor_traits;
|
||||
|
||||
template < typename Class, typename... Args >
|
||||
concept class_constructor_kind //
|
||||
= class_kind<Class> && std::is_constructible_v<Class, Args...>;
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < class_kind Class, typename... Args >
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class destructor_flags : std::uint32_t {
|
||||
@@ -19,6 +21,16 @@ namespace meta_hpp::detail
|
||||
META_HPP_DETAIL_BITFLAGS_OPERATORS_DECL(destructor_flags)
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < class_kind Class >
|
||||
struct destructor_traits;
|
||||
|
||||
template < typename Class >
|
||||
concept class_destructor_kind //
|
||||
= class_kind<Class> && std::is_destructible_v<Class>;
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < class_kind Class >
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class enum_flags : std::uint32_t {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class function_flags : std::uint32_t {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class member_flags : std::uint32_t {
|
||||
@@ -24,6 +26,14 @@ namespace meta_hpp::detail
|
||||
template < member_pointer_kind Member >
|
||||
struct member_traits;
|
||||
|
||||
template < typename Member, typename Class >
|
||||
concept class_member_pointer_kind //
|
||||
= class_kind<Class> && member_pointer_kind<Member> //
|
||||
&& std::is_same_v<Class, typename member_traits<Member>::class_type>;
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename V, typename C >
|
||||
struct member_traits<V C::*> {
|
||||
using cv_value_type = V;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class method_flags : std::uint32_t {
|
||||
@@ -26,6 +28,14 @@ namespace meta_hpp::detail
|
||||
template < method_pointer_kind Method >
|
||||
struct method_traits;
|
||||
|
||||
template < typename Method, typename Class >
|
||||
concept class_method_pointer_kind //
|
||||
= class_kind<Class> && method_pointer_kind<Method> //
|
||||
&& std::is_same_v<Class, typename method_traits<Method>::class_type>;
|
||||
}
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename R, typename C, typename... Args >
|
||||
struct method_traits<R (C::*)(Args...)> {
|
||||
static constexpr std::size_t arity{sizeof...(Args)};
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class number_flags : std::uint32_t {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class pointer_flags : std::uint32_t {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
|
||||
#include "../type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
enum class reference_flags : std::uint32_t {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../meta_base.hpp"
|
||||
#include "../../meta_concepts.hpp"
|
||||
#include "../../meta_registry.hpp"
|
||||
#include "../../meta_uresult.hpp"
|
||||
#include "../../meta_uvalue.hpp"
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "https://github.com/blackmatov/meta.hpp"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2021-2024, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
|
||||
#include "meta_detail/type_family.hpp"
|
||||
#include "meta_detail/type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
using detail::array_bitflags;
|
||||
using detail::array_flags;
|
||||
|
||||
using detail::class_bitflags;
|
||||
using detail::class_flags;
|
||||
|
||||
using detail::constructor_bitflags;
|
||||
using detail::constructor_flags;
|
||||
|
||||
using detail::destructor_bitflags;
|
||||
using detail::destructor_flags;
|
||||
|
||||
using detail::enum_bitflags;
|
||||
using detail::enum_flags;
|
||||
|
||||
using detail::function_bitflags;
|
||||
using detail::function_flags;
|
||||
|
||||
using detail::member_bitflags;
|
||||
using detail::member_flags;
|
||||
|
||||
using detail::method_bitflags;
|
||||
using detail::method_flags;
|
||||
|
||||
using detail::number_bitflags;
|
||||
using detail::number_flags;
|
||||
|
||||
using detail::pointer_bitflags;
|
||||
using detail::pointer_flags;
|
||||
|
||||
using detail::reference_bitflags;
|
||||
using detail::reference_flags;
|
||||
}
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
using detail::type_kind;
|
||||
|
||||
using detail::array_kind;
|
||||
using detail::class_kind;
|
||||
using detail::enum_kind;
|
||||
using detail::function_kind;
|
||||
using detail::function_pointer_kind;
|
||||
using detail::member_pointer_kind;
|
||||
using detail::method_pointer_kind;
|
||||
using detail::nullptr_kind;
|
||||
using detail::number_kind;
|
||||
using detail::pointer_kind;
|
||||
using detail::reference_kind;
|
||||
using detail::void_kind;
|
||||
|
||||
using detail::any_pointer_family;
|
||||
using detail::not_any_pointer_family;
|
||||
|
||||
using detail::class_constructor_kind;
|
||||
using detail::class_destructor_kind;
|
||||
using detail::class_member_pointer_kind;
|
||||
using detail::class_method_pointer_kind;
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
#include "meta_concepts.hpp"
|
||||
#include "meta_details.hpp"
|
||||
#include "meta_states.hpp"
|
||||
#include "meta_uresult.hpp"
|
||||
#include "meta_uvalue.hpp"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
#include "meta_concepts.hpp"
|
||||
#include "meta_details.hpp"
|
||||
#include "meta_states.hpp"
|
||||
#include "meta_types.hpp"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
#include "meta_concepts.hpp"
|
||||
#include "meta_details.hpp"
|
||||
#include "meta_indices.hpp"
|
||||
#include "meta_policies.hpp"
|
||||
#include "meta_types.hpp"
|
||||
|
||||
@@ -7,46 +7,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
#include "meta_concepts.hpp"
|
||||
#include "meta_details.hpp"
|
||||
#include "meta_uvalue.hpp"
|
||||
|
||||
#include "meta_detail/type_family.hpp"
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
using detail::array_bitflags;
|
||||
using detail::array_flags;
|
||||
|
||||
using detail::class_bitflags;
|
||||
using detail::class_flags;
|
||||
|
||||
using detail::constructor_bitflags;
|
||||
using detail::constructor_flags;
|
||||
|
||||
using detail::destructor_bitflags;
|
||||
using detail::destructor_flags;
|
||||
|
||||
using detail::enum_bitflags;
|
||||
using detail::enum_flags;
|
||||
|
||||
using detail::function_bitflags;
|
||||
using detail::function_flags;
|
||||
|
||||
using detail::member_bitflags;
|
||||
using detail::member_flags;
|
||||
|
||||
using detail::method_bitflags;
|
||||
using detail::method_flags;
|
||||
|
||||
using detail::number_bitflags;
|
||||
using detail::number_flags;
|
||||
|
||||
using detail::pointer_bitflags;
|
||||
using detail::pointer_flags;
|
||||
|
||||
using detail::reference_bitflags;
|
||||
using detail::reference_flags;
|
||||
}
|
||||
#include "meta_detail/type_kinds.hpp"
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "meta_base.hpp"
|
||||
#include "meta_concepts.hpp"
|
||||
#include "meta_details.hpp"
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user