mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-15 03:45:30 +07:00
@@ -170,21 +170,6 @@ namespace meta_hpp
|
|||||||
struct pointer_type_data;
|
struct pointer_type_data;
|
||||||
struct reference_type_data;
|
struct reference_type_data;
|
||||||
struct void_type_data;
|
struct void_type_data;
|
||||||
|
|
||||||
using type_data_base_ptr = std::shared_ptr<type_data_base>;
|
|
||||||
using array_type_data_ptr = std::shared_ptr<array_type_data>;
|
|
||||||
using class_type_data_ptr = std::shared_ptr<class_type_data>;
|
|
||||||
using constructor_type_data_ptr = std::shared_ptr<constructor_type_data>;
|
|
||||||
using destructor_type_data_ptr = std::shared_ptr<destructor_type_data>;
|
|
||||||
using enum_type_data_ptr = std::shared_ptr<enum_type_data>;
|
|
||||||
using function_type_data_ptr = std::shared_ptr<function_type_data>;
|
|
||||||
using member_type_data_ptr = std::shared_ptr<member_type_data>;
|
|
||||||
using method_type_data_ptr = std::shared_ptr<method_type_data>;
|
|
||||||
using nullptr_type_data_ptr = std::shared_ptr<nullptr_type_data>;
|
|
||||||
using number_type_data_ptr = std::shared_ptr<number_type_data>;
|
|
||||||
using pointer_type_data_ptr = std::shared_ptr<pointer_type_data>;
|
|
||||||
using reference_type_data_ptr = std::shared_ptr<reference_type_data>;
|
|
||||||
using void_type_data_ptr = std::shared_ptr<void_type_data>;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ namespace meta_hpp
|
|||||||
explicit array_bind(metadata_map metadata);
|
explicit array_bind(metadata_map metadata);
|
||||||
operator array_type() const noexcept;
|
operator array_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::array_type_data_ptr data_;
|
detail::array_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,8 +220,8 @@ namespace meta_hpp
|
|||||||
variable_opts opts,
|
variable_opts opts,
|
||||||
Policy = Policy{});
|
Policy = Policy{});
|
||||||
private:
|
private:
|
||||||
detail::class_type_data_ptr data_;
|
detail::class_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,8 +236,8 @@ namespace meta_hpp
|
|||||||
enum_bind& evalue_(std::string name, Enum value);
|
enum_bind& evalue_(std::string name, Enum value);
|
||||||
enum_bind& evalue_(std::string name, Enum value, evalue_opts opts);
|
enum_bind& evalue_(std::string name, Enum value, evalue_opts opts);
|
||||||
private:
|
private:
|
||||||
detail::enum_type_data_ptr data_;
|
detail::enum_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,8 +249,8 @@ namespace meta_hpp
|
|||||||
explicit function_bind(metadata_map metadata);
|
explicit function_bind(metadata_map metadata);
|
||||||
operator function_type() const noexcept;
|
operator function_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::function_type_data_ptr data_;
|
detail::function_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,8 +262,8 @@ namespace meta_hpp
|
|||||||
explicit member_bind(metadata_map metadata);
|
explicit member_bind(metadata_map metadata);
|
||||||
operator member_type() const noexcept;
|
operator member_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::member_type_data_ptr data_;
|
detail::member_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,8 +275,8 @@ namespace meta_hpp
|
|||||||
explicit method_bind(metadata_map metadata);
|
explicit method_bind(metadata_map metadata);
|
||||||
operator method_type() const noexcept;
|
operator method_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::method_type_data_ptr data_;
|
detail::method_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,8 +288,8 @@ namespace meta_hpp
|
|||||||
explicit nullptr_bind(metadata_map metadata);
|
explicit nullptr_bind(metadata_map metadata);
|
||||||
operator nullptr_type() const noexcept;
|
operator nullptr_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::nullptr_type_data_ptr data_;
|
detail::nullptr_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,8 +301,8 @@ namespace meta_hpp
|
|||||||
explicit number_bind(metadata_map metadata);
|
explicit number_bind(metadata_map metadata);
|
||||||
operator number_type() const noexcept;
|
operator number_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::number_type_data_ptr data_;
|
detail::number_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,8 +314,8 @@ namespace meta_hpp
|
|||||||
explicit pointer_bind(metadata_map metadata);
|
explicit pointer_bind(metadata_map metadata);
|
||||||
operator pointer_type() const noexcept;
|
operator pointer_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::pointer_type_data_ptr data_;
|
detail::pointer_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,8 +327,8 @@ namespace meta_hpp
|
|||||||
explicit reference_bind(metadata_map metadata);
|
explicit reference_bind(metadata_map metadata);
|
||||||
operator reference_type() const noexcept;
|
operator reference_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::reference_type_data_ptr data_;
|
detail::reference_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,8 +340,8 @@ namespace meta_hpp
|
|||||||
explicit void_bind(metadata_map metadata);
|
explicit void_bind(metadata_map metadata);
|
||||||
operator void_type() const noexcept;
|
operator void_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::void_type_data_ptr data_;
|
detail::void_type_data* data_{};
|
||||||
detail::type_registry::locker locker_;
|
detail::type_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ namespace meta_hpp
|
|||||||
Policy = Policy{});
|
Policy = Policy{});
|
||||||
private:
|
private:
|
||||||
detail::scope_state_ptr state_;
|
detail::scope_state_ptr state_;
|
||||||
detail::state_registry::locker locker_;
|
detail::state_registry::locker locker_{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,81 +123,92 @@ namespace meta_hpp::detail
|
|||||||
//
|
//
|
||||||
|
|
||||||
template < array_kind Array >
|
template < array_kind Array >
|
||||||
[[nodiscard]] array_type_data_ptr resolve_array_type_data() {
|
[[nodiscard]] array_type_data* resolve_array_type_data() {
|
||||||
static array_type_data_ptr data{std::make_shared<array_type_data>(type_list<Array>{})};
|
static array_type_data data{type_list<Array>{}};
|
||||||
return ensure_type<Array>(data);
|
ensure_type<Array>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class_kind Class >
|
template < class_kind Class >
|
||||||
[[nodiscard]] class_type_data_ptr resolve_class_type_data() {
|
[[nodiscard]] class_type_data* resolve_class_type_data() {
|
||||||
static class_type_data_ptr data{std::make_shared<class_type_data>(type_list<Class>{})};
|
static class_type_data data{type_list<Class>{}};
|
||||||
return ensure_type<Class>(data);
|
ensure_type<Class>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class_kind Class, typename... Args >
|
template < class_kind Class, typename... Args >
|
||||||
[[nodiscard]] constructor_type_data_ptr resolve_constructor_type_data() {
|
[[nodiscard]] constructor_type_data* resolve_constructor_type_data() {
|
||||||
static constructor_type_data_ptr data{std::make_shared<constructor_type_data>(type_list<Class>{}, type_list<Args...>{})};
|
static constructor_type_data data{type_list<Class>{}, type_list<Args...>{}};
|
||||||
return data;
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class_kind Class >
|
template < class_kind Class >
|
||||||
[[nodiscard]] destructor_type_data_ptr resolve_destructor_type_data() {
|
[[nodiscard]] destructor_type_data* resolve_destructor_type_data() {
|
||||||
static destructor_type_data_ptr data{std::make_shared<destructor_type_data>(type_list<Class>{})};
|
static destructor_type_data data{type_list<Class>{}};
|
||||||
return data;
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < enum_kind Enum >
|
template < enum_kind Enum >
|
||||||
[[nodiscard]] enum_type_data_ptr resolve_enum_type_data() {
|
[[nodiscard]] enum_type_data* resolve_enum_type_data() {
|
||||||
static enum_type_data_ptr data{std::make_shared<enum_type_data>(type_list<Enum>{})};
|
static enum_type_data data{type_list<Enum>{}};
|
||||||
return ensure_type<Enum>(data);
|
ensure_type<Enum>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < function_kind Function >
|
template < function_kind Function >
|
||||||
[[nodiscard]] function_type_data_ptr resolve_function_type_data() {
|
[[nodiscard]] function_type_data* resolve_function_type_data() {
|
||||||
static function_type_data_ptr data{std::make_shared<function_type_data>(type_list<Function>{})};
|
static function_type_data data{type_list<Function>{}};
|
||||||
return ensure_type<Function>(data);
|
ensure_type<Function>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < member_kind Member >
|
template < member_kind Member >
|
||||||
[[nodiscard]] member_type_data_ptr resolve_member_type_data() {
|
[[nodiscard]] member_type_data* resolve_member_type_data() {
|
||||||
static member_type_data_ptr data{std::make_shared<member_type_data>(type_list<Member>{})};
|
static member_type_data data{type_list<Member>{}};
|
||||||
return ensure_type<Member>(data);
|
ensure_type<Member>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < method_kind Method >
|
template < method_kind Method >
|
||||||
[[nodiscard]] method_type_data_ptr resolve_method_type_data() {
|
[[nodiscard]] method_type_data* resolve_method_type_data() {
|
||||||
static method_type_data_ptr data{std::make_shared<method_type_data>(type_list<Method>{})};
|
static method_type_data data{type_list<Method>{}};
|
||||||
return ensure_type<Method>(data);
|
ensure_type<Method>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < nullptr_kind Nullptr >
|
template < nullptr_kind Nullptr >
|
||||||
[[nodiscard]] nullptr_type_data_ptr resolve_nullptr_type_data() {
|
[[nodiscard]] nullptr_type_data* resolve_nullptr_type_data() {
|
||||||
static nullptr_type_data_ptr data{std::make_shared<nullptr_type_data>(type_list<Nullptr>{})};
|
static nullptr_type_data data{type_list<Nullptr>{}};
|
||||||
return ensure_type<Nullptr>(data);
|
ensure_type<Nullptr>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < number_kind Number >
|
template < number_kind Number >
|
||||||
[[nodiscard]] number_type_data_ptr resolve_number_type_data() {
|
[[nodiscard]] number_type_data* resolve_number_type_data() {
|
||||||
static number_type_data_ptr data{std::make_shared<number_type_data>(type_list<Number>{})};
|
static number_type_data data{type_list<Number>{}};
|
||||||
return ensure_type<Number>(data);
|
ensure_type<Number>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < pointer_kind Pointer >
|
template < pointer_kind Pointer >
|
||||||
[[nodiscard]] pointer_type_data_ptr resolve_pointer_type_data() {
|
[[nodiscard]] pointer_type_data* resolve_pointer_type_data() {
|
||||||
static pointer_type_data_ptr data{std::make_shared<pointer_type_data>(type_list<Pointer>{})};
|
static pointer_type_data data{type_list<Pointer>{}};
|
||||||
return ensure_type<Pointer>(data);
|
ensure_type<Pointer>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < reference_kind Reference >
|
template < reference_kind Reference >
|
||||||
[[nodiscard]] reference_type_data_ptr resolve_reference_type_data() {
|
[[nodiscard]] reference_type_data* resolve_reference_type_data() {
|
||||||
static reference_type_data_ptr data{std::make_shared<reference_type_data>(type_list<Reference>{})};
|
static reference_type_data data{type_list<Reference>{}};
|
||||||
return ensure_type<Reference>(data);
|
ensure_type<Reference>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template < void_kind Void >
|
template < void_kind Void >
|
||||||
[[nodiscard]] void_type_data_ptr resolve_void_type_data() {
|
[[nodiscard]] void_type_data* resolve_void_type_data() {
|
||||||
static void_type_data_ptr data{std::make_shared<void_type_data>(type_list<Void>{})};
|
static void_type_data data{type_list<Void>{}};
|
||||||
return ensure_type<Void>(data);
|
ensure_type<Void>(data);
|
||||||
|
return &data;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
class locker : noncopyable {
|
class locker : noncopyable {
|
||||||
@@ -211,16 +222,15 @@ namespace meta_hpp::detail
|
|||||||
type_registry() = default;
|
type_registry() = default;
|
||||||
|
|
||||||
template < typename Type, typename TypeData >
|
template < typename Type, typename TypeData >
|
||||||
TypeData ensure_type(const TypeData& type_data) {
|
void ensure_type(TypeData& type_data) {
|
||||||
static std::once_flag init_flag{};
|
static std::once_flag init_flag{};
|
||||||
std::call_once(init_flag, [this, &type_data](){
|
std::call_once(init_flag, [this, &type_data](){
|
||||||
const locker lock;
|
const locker lock;
|
||||||
type_by_id_[type_data->id] = any_type{type_data};
|
type_by_id_.emplace(type_data.id, any_type{&type_data});
|
||||||
#ifndef META_HPP_NO_RTTI
|
#ifndef META_HPP_NO_RTTI
|
||||||
type_by_rtti_[typeid(Type)] = any_type{type_data};
|
type_by_rtti_.emplace(typeid(Type), any_type{&type_data});
|
||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
return type_data;
|
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
std::recursive_mutex mutex_;
|
std::recursive_mutex mutex_;
|
||||||
|
|||||||
@@ -114,14 +114,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] reference_type as_reference() const noexcept;
|
[[nodiscard]] reference_type as_reference() const noexcept;
|
||||||
[[nodiscard]] void_type as_void() const noexcept;
|
[[nodiscard]] void_type as_void() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::type_data_base_ptr data_;
|
detail::type_data_base* data_{};
|
||||||
friend auto detail::type_access<any_type>(const any_type&);
|
friend auto detail::type_access<any_type>(const any_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class array_type final {
|
class array_type final {
|
||||||
public:
|
public:
|
||||||
array_type() = default;
|
array_type() = default;
|
||||||
array_type(detail::array_type_data_ptr data);
|
array_type(detail::array_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -133,14 +133,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] std::size_t get_extent() const noexcept;
|
[[nodiscard]] std::size_t get_extent() const noexcept;
|
||||||
[[nodiscard]] any_type get_data_type() const noexcept;
|
[[nodiscard]] any_type get_data_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::array_type_data_ptr data_;
|
detail::array_type_data* data_{};
|
||||||
friend auto detail::type_access<array_type>(const array_type&);
|
friend auto detail::type_access<array_type>(const array_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class class_type final {
|
class class_type final {
|
||||||
public:
|
public:
|
||||||
class_type() = default;
|
class_type() = default;
|
||||||
class_type(detail::class_type_data_ptr data);
|
class_type(detail::class_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -208,14 +208,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] method get_method_with(std::string_view name, const std::vector<any_type>& args) const noexcept;
|
[[nodiscard]] method get_method_with(std::string_view name, const std::vector<any_type>& args) const noexcept;
|
||||||
[[nodiscard]] method get_method_with(std::string_view name, std::initializer_list<any_type> args) const noexcept;
|
[[nodiscard]] method get_method_with(std::string_view name, std::initializer_list<any_type> args) const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::class_type_data_ptr data_;
|
detail::class_type_data* data_{};
|
||||||
friend auto detail::type_access<class_type>(const class_type&);
|
friend auto detail::type_access<class_type>(const class_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class constructor_type final {
|
class constructor_type final {
|
||||||
public:
|
public:
|
||||||
constructor_type() = default;
|
constructor_type() = default;
|
||||||
constructor_type(detail::constructor_type_data_ptr data);
|
constructor_type(detail::constructor_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -229,14 +229,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept;
|
[[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept;
|
||||||
[[nodiscard]] const std::vector<any_type>& get_argument_types() const noexcept;
|
[[nodiscard]] const std::vector<any_type>& get_argument_types() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::constructor_type_data_ptr data_;
|
detail::constructor_type_data* data_{};
|
||||||
friend auto detail::type_access<constructor_type>(const constructor_type&);
|
friend auto detail::type_access<constructor_type>(const constructor_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class destructor_type final {
|
class destructor_type final {
|
||||||
public:
|
public:
|
||||||
destructor_type() = default;
|
destructor_type() = default;
|
||||||
destructor_type(detail::destructor_type_data_ptr data);
|
destructor_type(detail::destructor_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -247,14 +247,14 @@ namespace meta_hpp
|
|||||||
|
|
||||||
[[nodiscard]] any_type get_class_type() const noexcept;
|
[[nodiscard]] any_type get_class_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::destructor_type_data_ptr data_;
|
detail::destructor_type_data* data_{};
|
||||||
friend auto detail::type_access<destructor_type>(const destructor_type&);
|
friend auto detail::type_access<destructor_type>(const destructor_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class enum_type final {
|
class enum_type final {
|
||||||
public:
|
public:
|
||||||
enum_type() = default;
|
enum_type() = default;
|
||||||
enum_type(detail::enum_type_data_ptr data);
|
enum_type(detail::enum_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -273,14 +273,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] std::string_view value_to_name(Value&& value) const noexcept;
|
[[nodiscard]] std::string_view value_to_name(Value&& value) const noexcept;
|
||||||
[[nodiscard]] uvalue name_to_value(std::string_view name) const noexcept;
|
[[nodiscard]] uvalue name_to_value(std::string_view name) const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::enum_type_data_ptr data_;
|
detail::enum_type_data* data_{};
|
||||||
friend auto detail::type_access<enum_type>(const enum_type&);
|
friend auto detail::type_access<enum_type>(const enum_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class function_type final {
|
class function_type final {
|
||||||
public:
|
public:
|
||||||
function_type() = default;
|
function_type() = default;
|
||||||
function_type(detail::function_type_data_ptr data);
|
function_type(detail::function_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -294,14 +294,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept;
|
[[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept;
|
||||||
[[nodiscard]] const std::vector<any_type>& get_argument_types() const noexcept;
|
[[nodiscard]] const std::vector<any_type>& get_argument_types() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::function_type_data_ptr data_;
|
detail::function_type_data* data_{};
|
||||||
friend auto detail::type_access<function_type>(const function_type&);
|
friend auto detail::type_access<function_type>(const function_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class member_type final {
|
class member_type final {
|
||||||
public:
|
public:
|
||||||
member_type() = default;
|
member_type() = default;
|
||||||
member_type(detail::member_type_data_ptr data);
|
member_type(detail::member_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -313,14 +313,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] class_type get_owner_type() const noexcept;
|
[[nodiscard]] class_type get_owner_type() const noexcept;
|
||||||
[[nodiscard]] any_type get_value_type() const noexcept;
|
[[nodiscard]] any_type get_value_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::member_type_data_ptr data_;
|
detail::member_type_data* data_{};
|
||||||
friend auto detail::type_access<member_type>(const member_type&);
|
friend auto detail::type_access<member_type>(const member_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class method_type final {
|
class method_type final {
|
||||||
public:
|
public:
|
||||||
method_type() = default;
|
method_type() = default;
|
||||||
method_type(detail::method_type_data_ptr data);
|
method_type(detail::method_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -335,14 +335,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept;
|
[[nodiscard]] any_type get_argument_type(std::size_t position) const noexcept;
|
||||||
[[nodiscard]] const std::vector<any_type>& get_argument_types() const noexcept;
|
[[nodiscard]] const std::vector<any_type>& get_argument_types() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::method_type_data_ptr data_;
|
detail::method_type_data* data_{};
|
||||||
friend auto detail::type_access<method_type>(const method_type&);
|
friend auto detail::type_access<method_type>(const method_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class nullptr_type final {
|
class nullptr_type final {
|
||||||
public:
|
public:
|
||||||
nullptr_type() = default;
|
nullptr_type() = default;
|
||||||
nullptr_type(detail::nullptr_type_data_ptr data);
|
nullptr_type(detail::nullptr_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -350,14 +350,14 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] type_id get_id() const noexcept;
|
[[nodiscard]] type_id get_id() const noexcept;
|
||||||
[[nodiscard]] const metadata_map& get_metadata() const noexcept;
|
[[nodiscard]] const metadata_map& get_metadata() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::nullptr_type_data_ptr data_;
|
detail::nullptr_type_data* data_{};
|
||||||
friend auto detail::type_access<nullptr_type>(const nullptr_type&);
|
friend auto detail::type_access<nullptr_type>(const nullptr_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class number_type final {
|
class number_type final {
|
||||||
public:
|
public:
|
||||||
number_type() = default;
|
number_type() = default;
|
||||||
number_type(detail::number_type_data_ptr data);
|
number_type(detail::number_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -368,14 +368,14 @@ namespace meta_hpp
|
|||||||
|
|
||||||
[[nodiscard]] std::size_t get_size() const noexcept;
|
[[nodiscard]] std::size_t get_size() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::number_type_data_ptr data_;
|
detail::number_type_data* data_{};
|
||||||
friend auto detail::type_access<number_type>(const number_type&);
|
friend auto detail::type_access<number_type>(const number_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class pointer_type final {
|
class pointer_type final {
|
||||||
public:
|
public:
|
||||||
pointer_type() = default;
|
pointer_type() = default;
|
||||||
pointer_type(detail::pointer_type_data_ptr data);
|
pointer_type(detail::pointer_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -386,14 +386,14 @@ namespace meta_hpp
|
|||||||
|
|
||||||
[[nodiscard]] any_type get_data_type() const noexcept;
|
[[nodiscard]] any_type get_data_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::pointer_type_data_ptr data_;
|
detail::pointer_type_data* data_{};
|
||||||
friend auto detail::type_access<pointer_type>(const pointer_type&);
|
friend auto detail::type_access<pointer_type>(const pointer_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class reference_type final {
|
class reference_type final {
|
||||||
public:
|
public:
|
||||||
reference_type() = default;
|
reference_type() = default;
|
||||||
reference_type(detail::reference_type_data_ptr data);
|
reference_type(detail::reference_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -404,14 +404,14 @@ namespace meta_hpp
|
|||||||
|
|
||||||
[[nodiscard]] any_type get_data_type() const noexcept;
|
[[nodiscard]] any_type get_data_type() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::reference_type_data_ptr data_;
|
detail::reference_type_data* data_{};
|
||||||
friend auto detail::type_access<reference_type>(const reference_type&);
|
friend auto detail::type_access<reference_type>(const reference_type&);
|
||||||
};
|
};
|
||||||
|
|
||||||
class void_type final {
|
class void_type final {
|
||||||
public:
|
public:
|
||||||
void_type() = default;
|
void_type() = default;
|
||||||
void_type(detail::void_type_data_ptr data);
|
void_type(detail::void_type_data* data);
|
||||||
|
|
||||||
[[nodiscard]] bool is_valid() const noexcept;
|
[[nodiscard]] bool is_valid() const noexcept;
|
||||||
[[nodiscard]] explicit operator bool() const noexcept;
|
[[nodiscard]] explicit operator bool() const noexcept;
|
||||||
@@ -419,7 +419,7 @@ namespace meta_hpp
|
|||||||
[[nodiscard]] type_id get_id() const noexcept;
|
[[nodiscard]] type_id get_id() const noexcept;
|
||||||
[[nodiscard]] const metadata_map& get_metadata() const noexcept;
|
[[nodiscard]] const metadata_map& get_metadata() const noexcept;
|
||||||
private:
|
private:
|
||||||
detail::void_type_data_ptr data_;
|
detail::void_type_data* data_{};
|
||||||
friend auto detail::type_access<void_type>(const void_type&);
|
friend auto detail::type_access<void_type>(const void_type&);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline bool any_type::is_valid() const noexcept {
|
inline bool any_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline any_type::operator bool() const noexcept {
|
inline any_type::operator bool() const noexcept {
|
||||||
@@ -71,132 +71,119 @@ namespace meta_hpp
|
|||||||
: data_{detail::type_access(other)} {}
|
: data_{detail::type_access(other)} {}
|
||||||
|
|
||||||
inline bool any_type::is_array() const noexcept {
|
inline bool any_type::is_array() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::array_;
|
return is_valid() && data_->kind == type_kind::array_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_class() const noexcept {
|
inline bool any_type::is_class() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::class_;
|
return is_valid() && data_->kind == type_kind::class_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_constructor() const noexcept {
|
inline bool any_type::is_constructor() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::constructor_;
|
return is_valid() && data_->kind == type_kind::constructor_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_destructor() const noexcept {
|
inline bool any_type::is_destructor() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::destructor_;
|
return is_valid() && data_->kind == type_kind::destructor_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_enum() const noexcept {
|
inline bool any_type::is_enum() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::enum_;
|
return is_valid() && data_->kind == type_kind::enum_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_function() const noexcept {
|
inline bool any_type::is_function() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::function_;
|
return is_valid() && data_->kind == type_kind::function_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_member() const noexcept {
|
inline bool any_type::is_member() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::member_;
|
return is_valid() && data_->kind == type_kind::member_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_method() const noexcept {
|
inline bool any_type::is_method() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::method_;
|
return is_valid() && data_->kind == type_kind::method_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_nullptr() const noexcept {
|
inline bool any_type::is_nullptr() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::nullptr_;
|
return is_valid() && data_->kind == type_kind::nullptr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_number() const noexcept {
|
inline bool any_type::is_number() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::number_;
|
return is_valid() && data_->kind == type_kind::number_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_pointer() const noexcept {
|
inline bool any_type::is_pointer() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::pointer_;
|
return is_valid() && data_->kind == type_kind::pointer_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_reference() const noexcept {
|
inline bool any_type::is_reference() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::reference_;
|
return is_valid() && data_->kind == type_kind::reference_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool any_type::is_void() const noexcept {
|
inline bool any_type::is_void() const noexcept {
|
||||||
return data_ && data_->kind == type_kind::void_;
|
return is_valid() && data_->kind == type_kind::void_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline array_type any_type::as_array() const noexcept {
|
inline array_type any_type::as_array() const noexcept {
|
||||||
return is_array()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? array_type{std::static_pointer_cast<detail::array_type_data>(data_)}
|
return is_array() ? array_type{static_cast<detail::array_type_data*>(data_)} : array_type{};
|
||||||
: array_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline class_type any_type::as_class() const noexcept {
|
inline class_type any_type::as_class() const noexcept {
|
||||||
return is_class()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? class_type{std::static_pointer_cast<detail::class_type_data>(data_)}
|
return is_class() ? class_type{static_cast<detail::class_type_data*>(data_)} : class_type{};
|
||||||
: class_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constructor_type any_type::as_constructor() const noexcept {
|
inline constructor_type any_type::as_constructor() const noexcept {
|
||||||
return is_constructor()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? constructor_type{std::static_pointer_cast<detail::constructor_type_data>(data_)}
|
return is_constructor() ? constructor_type{static_cast<detail::constructor_type_data*>(data_)} : constructor_type{};
|
||||||
: constructor_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline destructor_type any_type::as_destructor() const noexcept {
|
inline destructor_type any_type::as_destructor() const noexcept {
|
||||||
return is_destructor()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? destructor_type{std::static_pointer_cast<detail::destructor_type_data>(data_)}
|
return is_destructor() ? destructor_type{static_cast<detail::destructor_type_data*>(data_)} : destructor_type{};
|
||||||
: destructor_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline enum_type any_type::as_enum() const noexcept {
|
inline enum_type any_type::as_enum() const noexcept {
|
||||||
return is_enum()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? enum_type{std::static_pointer_cast<detail::enum_type_data>(data_)}
|
return is_enum() ? enum_type{static_cast<detail::enum_type_data*>(data_)} : enum_type{};
|
||||||
: enum_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline function_type any_type::as_function() const noexcept {
|
inline function_type any_type::as_function() const noexcept {
|
||||||
return is_function()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? function_type{std::static_pointer_cast<detail::function_type_data>(data_)}
|
return is_function() ? function_type{static_cast<detail::function_type_data*>(data_)} : function_type{};
|
||||||
: function_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline member_type any_type::as_member() const noexcept {
|
inline member_type any_type::as_member() const noexcept {
|
||||||
return is_member()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? member_type{std::static_pointer_cast<detail::member_type_data>(data_)}
|
return is_member() ? member_type{static_cast<detail::member_type_data*>(data_)} : member_type{};
|
||||||
: member_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline method_type any_type::as_method() const noexcept {
|
inline method_type any_type::as_method() const noexcept {
|
||||||
return is_method()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? method_type{std::static_pointer_cast<detail::method_type_data>(data_)}
|
return is_method() ? method_type{static_cast<detail::method_type_data*>(data_)} : method_type{};
|
||||||
: method_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline nullptr_type any_type::as_nullptr() const noexcept {
|
inline nullptr_type any_type::as_nullptr() const noexcept {
|
||||||
return is_nullptr()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? nullptr_type{std::static_pointer_cast<detail::nullptr_type_data>(data_)}
|
return is_nullptr() ? nullptr_type{static_cast<detail::nullptr_type_data*>(data_)} : nullptr_type{};
|
||||||
: nullptr_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline number_type any_type::as_number() const noexcept {
|
inline number_type any_type::as_number() const noexcept {
|
||||||
return is_number()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? number_type{std::static_pointer_cast<detail::number_type_data>(data_)}
|
return is_number() ? number_type{static_cast<detail::number_type_data*>(data_)} : number_type{};
|
||||||
: number_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline pointer_type any_type::as_pointer() const noexcept {
|
inline pointer_type any_type::as_pointer() const noexcept {
|
||||||
return is_pointer()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? pointer_type{std::static_pointer_cast<detail::pointer_type_data>(data_)}
|
return is_pointer() ? pointer_type{static_cast<detail::pointer_type_data*>(data_)} : pointer_type{};
|
||||||
: pointer_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline reference_type any_type::as_reference() const noexcept {
|
inline reference_type any_type::as_reference() const noexcept {
|
||||||
return is_reference()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? reference_type{std::static_pointer_cast<detail::reference_type_data>(data_)}
|
return is_reference() ? reference_type{static_cast<detail::reference_type_data*>(data_)} : reference_type{};
|
||||||
: reference_type{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void_type any_type::as_void() const noexcept {
|
inline void_type any_type::as_void() const noexcept {
|
||||||
return is_void()
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
|
||||||
? void_type{std::static_pointer_cast<detail::void_type_data>(data_)}
|
return is_void() ? void_type{static_cast<detail::void_type_data*>(data_)} : void_type{};
|
||||||
: void_type{};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline array_type::array_type(detail::array_type_data_ptr data)
|
inline array_type::array_type(detail::array_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool array_type::is_valid() const noexcept {
|
inline bool array_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline array_type::operator bool() const noexcept {
|
inline array_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline class_type::class_type(detail::class_type_data_ptr data)
|
inline class_type::class_type(detail::class_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool class_type::is_valid() const noexcept {
|
inline bool class_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline class_type::operator bool() const noexcept {
|
inline class_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline constructor_type::constructor_type(detail::constructor_type_data_ptr data)
|
inline constructor_type::constructor_type(detail::constructor_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool constructor_type::is_valid() const noexcept {
|
inline bool constructor_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constructor_type::operator bool() const noexcept {
|
inline constructor_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline destructor_type::destructor_type(detail::destructor_type_data_ptr data)
|
inline destructor_type::destructor_type(detail::destructor_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool destructor_type::is_valid() const noexcept {
|
inline bool destructor_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline destructor_type::operator bool() const noexcept {
|
inline destructor_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline enum_type::enum_type(detail::enum_type_data_ptr data)
|
inline enum_type::enum_type(detail::enum_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool enum_type::is_valid() const noexcept {
|
inline bool enum_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline enum_type::operator bool() const noexcept {
|
inline enum_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline function_type::function_type(detail::function_type_data_ptr data)
|
inline function_type::function_type(detail::function_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool function_type::is_valid() const noexcept {
|
inline bool function_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline function_type::operator bool() const noexcept {
|
inline function_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline member_type::member_type(detail::member_type_data_ptr data)
|
inline member_type::member_type(detail::member_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool member_type::is_valid() const noexcept {
|
inline bool member_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline member_type::operator bool() const noexcept {
|
inline member_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline method_type::method_type(detail::method_type_data_ptr data)
|
inline method_type::method_type(detail::method_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool method_type::is_valid() const noexcept {
|
inline bool method_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline method_type::operator bool() const noexcept {
|
inline method_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline nullptr_type::nullptr_type(detail::nullptr_type_data_ptr data)
|
inline nullptr_type::nullptr_type(detail::nullptr_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool nullptr_type::is_valid() const noexcept {
|
inline bool nullptr_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline nullptr_type::operator bool() const noexcept {
|
inline nullptr_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline number_type::number_type(detail::number_type_data_ptr data)
|
inline number_type::number_type(detail::number_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool number_type::is_valid() const noexcept {
|
inline bool number_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline number_type::operator bool() const noexcept {
|
inline number_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline pointer_type::pointer_type(detail::pointer_type_data_ptr data)
|
inline pointer_type::pointer_type(detail::pointer_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool pointer_type::is_valid() const noexcept {
|
inline bool pointer_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline pointer_type::operator bool() const noexcept {
|
inline pointer_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline reference_type::reference_type(detail::reference_type_data_ptr data)
|
inline reference_type::reference_type(detail::reference_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool reference_type::is_valid() const noexcept {
|
inline bool reference_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline reference_type::operator bool() const noexcept {
|
inline reference_type::operator bool() const noexcept {
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ namespace meta_hpp::detail
|
|||||||
|
|
||||||
namespace meta_hpp
|
namespace meta_hpp
|
||||||
{
|
{
|
||||||
inline void_type::void_type(detail::void_type_data_ptr data)
|
inline void_type::void_type(detail::void_type_data* data)
|
||||||
: data_{std::move(data)} {}
|
: data_{data} {}
|
||||||
|
|
||||||
inline bool void_type::is_valid() const noexcept {
|
inline bool void_type::is_valid() const noexcept {
|
||||||
return !!data_;
|
return data_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void_type::operator bool() const noexcept {
|
inline void_type::operator bool() const noexcept {
|
||||||
|
|||||||
Reference in New Issue
Block a user