more nodiscards

This commit is contained in:
BlackMATov
2022-01-04 02:21:06 +07:00
parent f0ba3b9d4d
commit b73cf18fea
20 changed files with 198 additions and 198 deletions

View File

@@ -26,7 +26,7 @@ namespace meta_hpp
}
template < detail::state_family T, detail::state_family U >
bool operator<(const T& l, const U& r) noexcept {
[[nodiscard]] bool operator<(const T& l, const U& r) noexcept {
if ( !static_cast<bool>(r) ) {
return false;
}
@@ -39,7 +39,7 @@ namespace meta_hpp
}
template < detail::state_family T, detail::state_family U >
bool operator==(const T& l, const U& r) noexcept {
[[nodiscard]] bool operator==(const T& l, const U& r) noexcept {
if ( static_cast<bool>(l) != static_cast<bool>(r) ) {
return false;
}
@@ -52,7 +52,7 @@ namespace meta_hpp
}
template < detail::state_family T, detail::state_family U >
bool operator!=(const T& l, const U& r) noexcept {
[[nodiscard]] bool operator!=(const T& l, const U& r) noexcept {
return !(l == r);
}
}
@@ -64,11 +64,11 @@ namespace meta_hpp
explicit ctor() = default;
explicit ctor(detail::ctor_state_ptr state);
bool is_valid() const noexcept;
explicit operator bool() const noexcept;
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
const ctor_index& get_index() const noexcept;
const ctor_type& get_type() const noexcept;
[[nodiscard]] const ctor_index& get_index() const noexcept;
[[nodiscard]] const ctor_type& get_type() const noexcept;
template < typename... Args >
value invoke(Args&&... args) const;
@@ -77,10 +77,10 @@ namespace meta_hpp
value operator()(Args&&... args) const;
template < typename... Args >
bool is_invocable_with() const noexcept;
[[nodiscard]] bool is_invocable_with() const noexcept;
template < typename... Args >
bool is_invocable_with(Args&&... args) const noexcept;
[[nodiscard]] bool is_invocable_with(Args&&... args) const noexcept;
private:
detail::ctor_state_ptr state_;
};
@@ -90,14 +90,14 @@ namespace meta_hpp
explicit evalue() = default;
explicit evalue(detail::evalue_state_ptr state);
bool is_valid() const noexcept;
explicit operator bool() const noexcept;
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
const evalue_index& get_index() const noexcept;
const enum_type& get_type() const noexcept;
const std::string& get_name() const noexcept;
[[nodiscard]] const evalue_index& get_index() const noexcept;
[[nodiscard]] const enum_type& get_type() const noexcept;
[[nodiscard]] const std::string& get_name() const noexcept;
const value& get_value() const noexcept;
[[nodiscard]] const value& get_value() const noexcept;
private:
detail::evalue_state_ptr state_;
};
@@ -107,12 +107,12 @@ namespace meta_hpp
explicit function() = default;
explicit function(detail::function_state_ptr state);
bool is_valid() const noexcept;
explicit operator bool() const noexcept;
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
const function_index& get_index() const noexcept;
const function_type& get_type() const noexcept;
const std::string& get_name() const noexcept;
[[nodiscard]] const function_index& get_index() const noexcept;
[[nodiscard]] const function_type& get_type() const noexcept;
[[nodiscard]] const std::string& get_name() const noexcept;
template < typename... Args >
std::optional<value> invoke(Args&&... args) const;
@@ -121,10 +121,10 @@ namespace meta_hpp
std::optional<value> operator()(Args&&... args) const;
template < typename... Args >
bool is_invocable_with() const noexcept;
[[nodiscard]] bool is_invocable_with() const noexcept;
template < typename... Args >
bool is_invocable_with(Args&&... args) const noexcept;
[[nodiscard]] bool is_invocable_with(Args&&... args) const noexcept;
private:
detail::function_state_ptr state_;
};
@@ -134,15 +134,15 @@ namespace meta_hpp
explicit member() = default;
explicit member(detail::member_state_ptr state);
bool is_valid() const noexcept;
explicit operator bool() const noexcept;
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
const member_index& get_index() const noexcept;
const member_type& get_type() const noexcept;
const std::string& get_name() const noexcept;
[[nodiscard]] const member_index& get_index() const noexcept;
[[nodiscard]] const member_type& get_type() const noexcept;
[[nodiscard]] const std::string& get_name() const noexcept;
template < typename Instance >
value get(Instance&& instance) const;
[[nodiscard]] value get(Instance&& instance) const;
template < typename Instance, typename Value >
void set(Instance&& instance, Value&& value) const;
@@ -155,12 +155,12 @@ namespace meta_hpp
explicit method() = default;
explicit method(detail::method_state_ptr state);
bool is_valid() const noexcept;
explicit operator bool() const noexcept;
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
const method_index& get_index() const noexcept;
const method_type& get_type() const noexcept;
const std::string& get_name() const noexcept;
[[nodiscard]] const method_index& get_index() const noexcept;
[[nodiscard]] const method_type& get_type() const noexcept;
[[nodiscard]] const std::string& get_name() const noexcept;
template < typename Instance, typename... Args >
std::optional<value> invoke(Instance&& instance, Args&&... args) const;
@@ -169,10 +169,10 @@ namespace meta_hpp
std::optional<value> operator()(Instance&& instance, Args&&... args) const;
template < typename Instance, typename... Args >
bool is_invocable_with() const noexcept;
[[nodiscard]] bool is_invocable_with() const noexcept;
template < typename Instance, typename... Args >
bool is_invocable_with(Instance&& instance, Args&&... args) const noexcept;
[[nodiscard]] bool is_invocable_with(Instance&& instance, Args&&... args) const noexcept;
private:
detail::method_state_ptr state_;
};
@@ -182,26 +182,26 @@ namespace meta_hpp
explicit scope() = default;
explicit scope(detail::scope_state_ptr state);
bool is_valid() const noexcept;
explicit operator bool() const noexcept;
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
const scope_index& get_index() const noexcept;
const std::string& get_name() const noexcept;
[[nodiscard]] const scope_index& get_index() const noexcept;
[[nodiscard]] const std::string& get_name() const noexcept;
const class_map& get_classes() const noexcept;
const enum_map& get_enums() const noexcept;
const function_map& get_functions() const noexcept;
const variable_map& get_variables() const noexcept;
[[nodiscard]] const class_map& get_classes() const noexcept;
[[nodiscard]] const enum_map& get_enums() const noexcept;
[[nodiscard]] const function_map& get_functions() const noexcept;
[[nodiscard]] const variable_map& get_variables() const noexcept;
class_type get_class(std::string_view name) const noexcept;
enum_type get_enum(std::string_view name) const noexcept;
function get_function(std::string_view name) const noexcept;
variable get_variable(std::string_view name) const noexcept;
[[nodiscard]] class_type get_class(std::string_view name) const noexcept;
[[nodiscard]] enum_type get_enum(std::string_view name) const noexcept;
[[nodiscard]] function get_function(std::string_view name) const noexcept;
[[nodiscard]] variable get_variable(std::string_view name) const noexcept;
template < typename... Args >
function get_function_with(std::string_view name) const noexcept;
function get_function_with(std::string_view name, const std::vector<any_type>& args) const noexcept;
function get_function_with(std::string_view name, std::initializer_list<any_type> args) const noexcept;
[[nodiscard]] function get_function_with(std::string_view name) const noexcept;
[[nodiscard]] function get_function_with(std::string_view name, const std::vector<any_type>& args) const noexcept;
[[nodiscard]] function get_function_with(std::string_view name, std::initializer_list<any_type> args) const noexcept;
private:
detail::scope_state_ptr state_;
};
@@ -211,14 +211,14 @@ namespace meta_hpp
explicit variable() = default;
explicit variable(detail::variable_state_ptr state);
bool is_valid() const noexcept;
explicit operator bool() const noexcept;
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
const variable_index& get_index() const noexcept;
const pointer_type& get_type() const noexcept;
const std::string& get_name() const noexcept;
[[nodiscard]] const variable_index& get_index() const noexcept;
[[nodiscard]] const pointer_type& get_type() const noexcept;
[[nodiscard]] const std::string& get_name() const noexcept;
value get() const;
[[nodiscard]] value get() const;
template < typename Value >
void set(Value&& value) const;
@@ -239,10 +239,10 @@ namespace meta_hpp::detail
is_invocable_with_impl is_invocable_with;
template < class_kind Class, typename... Args >
static ctor_state_ptr make();
explicit ctor_state(ctor_index index, type_list<Class>, type_list<Args...>);
template < class_kind Class, typename... Args >
explicit ctor_state(ctor_index index, type_list<Class>, type_list<Args...>);
[[nodiscard]] static ctor_state_ptr make();
};
struct evalue_state final {
@@ -251,10 +251,10 @@ namespace meta_hpp::detail
class value value;
template < enum_kind Enum >
static evalue_state_ptr make(std::string name, Enum value);
explicit evalue_state(evalue_index index, Enum value);
template < enum_kind Enum >
explicit evalue_state(evalue_index index, Enum value);
[[nodiscard]] static evalue_state_ptr make(std::string name, Enum value);
};
struct function_state final {
@@ -267,10 +267,10 @@ namespace meta_hpp::detail
is_invocable_with_impl is_invocable_with;
template < function_kind Function >
static function_state_ptr make(std::string name, Function function);
explicit function_state(function_index index, Function function);
template < function_kind Function >
explicit function_state(function_index index, Function function);
[[nodiscard]] static function_state_ptr make(std::string name, Function function);
};
struct member_state final {
@@ -283,10 +283,10 @@ namespace meta_hpp::detail
setter_impl setter;
template < member_kind Member >
static member_state_ptr make(std::string name, Member member);
explicit member_state(member_index index, Member member);
template < member_kind Member >
explicit member_state(member_index index, Member member);
[[nodiscard]] static member_state_ptr make(std::string name, Member member);
};
struct method_state final {
@@ -299,10 +299,10 @@ namespace meta_hpp::detail
is_invocable_with_impl is_invocable_with;
template < method_kind Method >
static method_state_ptr make(std::string name, Method method);
explicit method_state(method_index index, Method method);
template < method_kind Method >
explicit method_state(method_index index, Method method);
[[nodiscard]] static method_state_ptr make(std::string name, Method method);
};
struct scope_state final {
@@ -313,10 +313,10 @@ namespace meta_hpp::detail
function_map functions;
variable_map variables;
static scope_state_ptr make(std::string name);
static scope_state_ptr get_static(std::string_view name);
explicit scope_state(scope_index index);
[[nodiscard]] static scope_state_ptr make(std::string name);
[[nodiscard]] static scope_state_ptr get_static(std::string_view name);
};
struct variable_state final {
@@ -329,16 +329,16 @@ namespace meta_hpp::detail
setter_impl setter;
template < pointer_kind Pointer >
static variable_state_ptr make(std::string name, Pointer pointer);
explicit variable_state(variable_index index, Pointer pointer);
template < pointer_kind Pointer >
explicit variable_state(variable_index index, Pointer pointer);
[[nodiscard]] static variable_state_ptr make(std::string name, Pointer pointer);
};
}
namespace meta_hpp
{
inline scope resolve_scope(std::string_view name) {
[[nodiscard]] inline scope resolve_scope(std::string_view name) {
return scope{detail::scope_state::get_static(name)};
}
}

View File

@@ -90,17 +90,17 @@ namespace meta_hpp::detail
namespace meta_hpp::detail
{
template < class_kind Class, typename... Args >
ctor_state_ptr ctor_state::make() {
ctor_index index{ctor_type_data::get_static<Class, Args...>()};
return std::make_shared<ctor_state>(std::move(index), type_list<Class>{}, type_list<Args...>{});
}
template < class_kind Class, typename... Args >
ctor_state::ctor_state(ctor_index index, type_list<Class>, type_list<Args...>)
: index{std::move(index)}
, invoke{make_ctor_invoke<Class, Args...>()}
, is_invocable_with{make_ctor_is_invocable_with<Class, Args...>()} {}
template < class_kind Class, typename... Args >
ctor_state_ptr ctor_state::make() {
ctor_index index{ctor_type_data::get_static<Class, Args...>()};
return std::make_shared<ctor_state>(std::move(index), type_list<Class>{}, type_list<Args...>{});
}
}
namespace meta_hpp

View File

@@ -13,16 +13,16 @@
namespace meta_hpp::detail
{
template < enum_kind Enum >
evalue_state::evalue_state(evalue_index index, Enum value)
: index{std::move(index)}
, value{std::move(value)} {}
template < enum_kind Enum >
evalue_state_ptr evalue_state::make(std::string name, Enum value) {
evalue_index index{enum_type_data::get_static<Enum>(), std::move(name)};
return std::make_shared<evalue_state>(std::move(index), std::move(value));
}
template < enum_kind Enum >
evalue_state::evalue_state(evalue_index index, Enum value)
: index{std::move(index)}
, value{std::move(value)} {}
}
namespace meta_hpp

View File

@@ -100,17 +100,17 @@ namespace meta_hpp::detail
namespace meta_hpp::detail
{
template < function_kind Function >
function_state_ptr function_state::make(std::string name, Function function) {
function_index index{function_type_data::get_static<Function>(), std::move(name)};
return std::make_shared<function_state>(std::move(index), std::move(function));
}
template < function_kind Function >
function_state::function_state(function_index index, Function function)
: index{std::move(index)}
, invoke{make_function_invoke(function)}
, is_invocable_with{make_function_is_invocable_with<Function>()} {}
template < function_kind Function >
function_state_ptr function_state::make(std::string name, Function function) {
function_index index{function_type_data::get_static<Function>(), std::move(name)};
return std::make_shared<function_state>(std::move(index), std::move(function));
}
}
namespace meta_hpp

View File

@@ -74,17 +74,17 @@ namespace meta_hpp::detail
namespace meta_hpp::detail
{
template < member_kind Member >
member_state_ptr member_state::make(std::string name, Member member) {
member_index index{member_type_data::get_static<Member>(), std::move(name)};
return std::make_shared<member_state>(std::move(index), std::move(member));
}
template < member_kind Member >
member_state::member_state(member_index index, Member member)
: index{std::move(index)}
, getter{make_member_getter(member)}
, setter{make_member_setter(member)} {}
template < member_kind Member >
member_state_ptr member_state::make(std::string name, Member member) {
member_index index{member_type_data::get_static<Member>(), std::move(name)};
return std::make_shared<member_state>(std::move(index), std::move(member));
}
}
namespace meta_hpp

View File

@@ -116,17 +116,17 @@ namespace meta_hpp::detail
namespace meta_hpp::detail
{
template < method_kind Method >
method_state_ptr method_state::make(std::string name, Method method) {
method_index index{method_type_data::get_static<Method>(), std::move(name)};
return std::make_shared<method_state>(std::move(index), std::move(method));
}
template < method_kind Method >
method_state::method_state(method_index index, Method method)
: index{std::move(index)}
, invoke{make_method_invoke(method)}
, is_invocable_with{make_method_is_invocable_with<Method>()} {}
template < method_kind Method >
method_state_ptr method_state::make(std::string name, Method method) {
method_index index{method_type_data::get_static<Method>(), std::move(name)};
return std::make_shared<method_state>(std::move(index), std::move(method));
}
}
namespace meta_hpp

View File

@@ -11,6 +11,9 @@
namespace meta_hpp::detail
{
inline scope_state::scope_state(scope_index index)
: index{std::move(index)} {}
inline scope_state_ptr scope_state::make(std::string name) {
scope_index index{std::move(name)};
return std::make_shared<scope_state>(std::move(index));
@@ -25,9 +28,6 @@ namespace meta_hpp::detail
return states.emplace(std::string{name}, make(std::string{name})).first->second;
}
inline scope_state::scope_state(scope_index index)
: index{std::move(index)} {}
}
namespace meta_hpp

View File

@@ -56,17 +56,17 @@ namespace meta_hpp::detail
namespace meta_hpp::detail
{
template < pointer_kind Pointer >
variable_state_ptr variable_state::make(std::string name, Pointer pointer) {
variable_index index{pointer_type_data::get_static<Pointer>(), std::move(name)};
return std::make_shared<variable_state>(index, pointer);
}
template < pointer_kind Pointer >
variable_state::variable_state(variable_index index, Pointer pointer)
: index{std::move(index)}
, getter{make_variable_getter(pointer)}
, setter{make_variable_setter(pointer)} {}
template < pointer_kind Pointer >
variable_state_ptr variable_state::make(std::string name, Pointer pointer) {
variable_index index{pointer_type_data::get_static<Pointer>(), std::move(name)};
return std::make_shared<variable_state>(index, pointer);
}
}
namespace meta_hpp

View File

@@ -436,10 +436,10 @@ namespace meta_hpp::detail
const any_type data_type;
template < array_kind Array >
static array_type_data_ptr get_static();
explicit array_type_data(type_list<Array>);
template < array_kind Array >
explicit array_type_data(type_list<Array>);
[[nodiscard]] static array_type_data_ptr get_static();
};
struct class_type_data final : type_data_base {
@@ -463,10 +463,10 @@ namespace meta_hpp::detail
base_info_map bases_info;
template < class_kind Class >
static class_type_data_ptr get_static();
explicit class_type_data(type_list<Class>);
template < class_kind Class >
explicit class_type_data(type_list<Class>);
[[nodiscard]] static class_type_data_ptr get_static();
};
struct ctor_type_data final : type_data_base {
@@ -475,10 +475,10 @@ namespace meta_hpp::detail
const std::vector<any_type> argument_types;
template < class_kind Class, typename... Args >
static ctor_type_data_ptr get_static();
explicit ctor_type_data(type_list<Class>, type_list<Args...>);
template < class_kind Class, typename... Args >
explicit ctor_type_data(type_list<Class>, type_list<Args...>);
[[nodiscard]] static ctor_type_data_ptr get_static();
};
struct enum_type_data final : type_data_base {
@@ -488,10 +488,10 @@ namespace meta_hpp::detail
evalue_map evalues;
template < enum_kind Enum >
static enum_type_data_ptr get_static();
explicit enum_type_data(type_list<Enum>);
template < enum_kind Enum >
explicit enum_type_data(type_list<Enum>);
[[nodiscard]] static enum_type_data_ptr get_static();
};
struct function_type_data final : type_data_base {
@@ -500,10 +500,10 @@ namespace meta_hpp::detail
const std::vector<any_type> argument_types;
template < function_kind Function >
static function_type_data_ptr get_static();
explicit function_type_data(type_list<Function>);
template < function_kind Function >
explicit function_type_data(type_list<Function>);
[[nodiscard]] static function_type_data_ptr get_static();
};
struct member_type_data final : type_data_base {
@@ -512,10 +512,10 @@ namespace meta_hpp::detail
const any_type value_type;
template < member_kind Member >
static member_type_data_ptr get_static();
explicit member_type_data(type_list<Member>);
template < member_kind Member >
explicit member_type_data(type_list<Member>);
[[nodiscard]] static member_type_data_ptr get_static();
};
struct method_type_data final : type_data_base {
@@ -525,10 +525,10 @@ namespace meta_hpp::detail
const std::vector<any_type> argument_types;
template < method_kind Method >
static method_type_data_ptr get_static();
explicit method_type_data(type_list<Method>);
template < method_kind Method >
explicit method_type_data(type_list<Method>);
[[nodiscard]] static method_type_data_ptr get_static();
};
struct number_type_data final : type_data_base {
@@ -536,10 +536,10 @@ namespace meta_hpp::detail
const std::size_t size;
template < number_kind Number >
static number_type_data_ptr get_static();
explicit number_type_data(type_list<Number>);
template < number_kind Number >
explicit number_type_data(type_list<Number>);
[[nodiscard]] static number_type_data_ptr get_static();
};
struct pointer_type_data final : type_data_base {
@@ -547,10 +547,10 @@ namespace meta_hpp::detail
const any_type data_type;
template < pointer_kind Pointer >
static pointer_type_data_ptr get_static();
explicit pointer_type_data(type_list<Pointer>);
template < pointer_kind Pointer >
explicit pointer_type_data(type_list<Pointer>);
[[nodiscard]] static pointer_type_data_ptr get_static();
};
struct reference_type_data final : type_data_base {
@@ -558,20 +558,20 @@ namespace meta_hpp::detail
const any_type data_type;
template < reference_kind Reference >
static reference_type_data_ptr get_static();
explicit reference_type_data(type_list<Reference>);
template < reference_kind Reference >
explicit reference_type_data(type_list<Reference>);
[[nodiscard]] static reference_type_data_ptr get_static();
};
struct void_type_data final : type_data_base {
const bitflags<void_flags> flags;
template < void_kind Void >
static void_type_data_ptr get_static();
explicit void_type_data(type_list<Void>);
template < void_kind Void >
explicit void_type_data(type_list<Void>);
[[nodiscard]] static void_type_data_ptr get_static();
};
}

View File

@@ -16,12 +16,6 @@ namespace meta_hpp::detail
template < array_kind Array >
struct array_tag {};
template < array_kind Array >
array_type_data_ptr array_type_data::get_static() {
static array_type_data_ptr data = std::make_shared<array_type_data>(type_list<Array>{});
return data;
}
template < array_kind Array >
// NOLINTNEXTLINE(readability-named-parameter)
array_type_data::array_type_data(type_list<Array>)
@@ -29,6 +23,12 @@ namespace meta_hpp::detail
, flags{array_traits<Array>::make_flags()}
, extent{array_traits<Array>::extent}
, data_type{resolve_type<typename array_traits<Array>::data_type>()} {}
template < array_kind Array >
array_type_data_ptr array_type_data::get_static() {
static array_type_data_ptr data = std::make_shared<array_type_data>(type_list<Array>{});
return data;
}
}
namespace meta_hpp

View File

@@ -22,12 +22,6 @@ namespace meta_hpp::detail
template < class_kind Class >
struct class_tag {};
template < class_kind Class >
class_type_data_ptr class_type_data::get_static() {
static class_type_data_ptr data = std::make_shared<class_type_data>(type_list<Class>{});
return data;
}
template < class_kind Class >
// NOLINTNEXTLINE(readability-named-parameter)
class_type_data::class_type_data(type_list<Class>)
@@ -35,6 +29,12 @@ namespace meta_hpp::detail
, flags{class_traits<Class>::make_flags()}
, size{class_traits<Class>::size}
, argument_types{class_traits<Class>::make_argument_types()} {}
template < class_kind Class >
class_type_data_ptr class_type_data::get_static() {
static class_type_data_ptr data = std::make_shared<class_type_data>(type_list<Class>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,12 +16,6 @@ namespace meta_hpp::detail
template < class_kind Class, typename... Args >
struct ctor_tag {};
template < class_kind Class, typename... Args >
ctor_type_data_ptr ctor_type_data::get_static() {
static ctor_type_data_ptr data = std::make_shared<ctor_type_data>(type_list<Class>{}, type_list<Args...>{});
return data;
}
template < class_kind Class, typename... Args >
// NOLINTNEXTLINE(readability-named-parameter)
ctor_type_data::ctor_type_data(type_list<Class>, type_list<Args...>)
@@ -29,6 +23,12 @@ namespace meta_hpp::detail
, flags{ctor_traits<Class, Args...>::make_flags()}
, class_type{resolve_type<typename ctor_traits<Class, Args...>::class_type>()}
, argument_types{ctor_traits<Class, Args...>::make_argument_types()} {}
template < class_kind Class, typename... Args >
ctor_type_data_ptr ctor_type_data::get_static() {
static ctor_type_data_ptr data = std::make_shared<ctor_type_data>(type_list<Class>{}, type_list<Args...>{});
return data;
}
}
namespace meta_hpp

View File

@@ -18,18 +18,18 @@ namespace meta_hpp::detail
template < enum_kind Enum >
struct enum_tag {};
template < enum_kind Enum >
enum_type_data_ptr enum_type_data::get_static() {
static enum_type_data_ptr data = std::make_shared<enum_type_data>(type_list<Enum>{});
return data;
}
template < enum_kind Enum >
// NOLINTNEXTLINE(readability-named-parameter)
enum_type_data::enum_type_data(type_list<Enum>)
: type_data_base{type_id{type_list<enum_tag<Enum>>{}}, type_kind::enum_}
, flags{enum_traits<Enum>::make_flags()}
, underlying_type{resolve_type<typename enum_traits<Enum>::underlying_type>()} {}
template < enum_kind Enum >
enum_type_data_ptr enum_type_data::get_static() {
static enum_type_data_ptr data = std::make_shared<enum_type_data>(type_list<Enum>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,12 +16,6 @@ namespace meta_hpp::detail
template < function_kind Function >
struct function_tag {};
template < function_kind Function >
function_type_data_ptr function_type_data::get_static() {
static function_type_data_ptr data = std::make_shared<function_type_data>(type_list<Function>{});
return data;
}
template < function_kind Function >
// NOLINTNEXTLINE(readability-named-parameter)
function_type_data::function_type_data(type_list<Function>)
@@ -29,6 +23,12 @@ namespace meta_hpp::detail
, flags{function_traits<Function>::make_flags()}
, return_type{resolve_type<typename function_traits<Function>::return_type>()}
, argument_types{function_traits<Function>::make_argument_types()} {}
template < function_kind Function >
function_type_data_ptr function_type_data::get_static() {
static function_type_data_ptr data = std::make_shared<function_type_data>(type_list<Function>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,12 +16,6 @@ namespace meta_hpp::detail
template < member_kind Member >
struct member_tag {};
template < member_kind Member >
member_type_data_ptr member_type_data::get_static() {
static member_type_data_ptr data = std::make_shared<member_type_data>(type_list<Member>{});
return data;
}
template < member_kind Member >
// NOLINTNEXTLINE(readability-named-parameter)
member_type_data::member_type_data(type_list<Member>)
@@ -29,6 +23,12 @@ namespace meta_hpp::detail
, flags{member_traits<Member>::make_flags()}
, owner_type{resolve_type<typename member_traits<Member>::class_type>()}
, value_type{resolve_type<typename member_traits<Member>::value_type>()} {}
template < member_kind Member >
member_type_data_ptr member_type_data::get_static() {
static member_type_data_ptr data = std::make_shared<member_type_data>(type_list<Member>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,12 +16,6 @@ namespace meta_hpp::detail
template < method_kind Method >
struct method_tag {};
template < method_kind Method >
method_type_data_ptr method_type_data::get_static() {
static method_type_data_ptr data = std::make_shared<method_type_data>(type_list<Method>{});
return data;
}
template < method_kind Method >
// NOLINTNEXTLINE(readability-named-parameter)
method_type_data::method_type_data(type_list<Method>)
@@ -30,6 +24,12 @@ namespace meta_hpp::detail
, owner_type{resolve_type<typename method_traits<Method>::class_type>()}
, return_type{resolve_type<typename method_traits<Method>::return_type>()}
, argument_types{method_traits<Method>::make_argument_types()} {}
template < method_kind Method >
method_type_data_ptr method_type_data::get_static() {
static method_type_data_ptr data = std::make_shared<method_type_data>(type_list<Method>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,18 +16,18 @@ namespace meta_hpp::detail
template < number_kind Number >
struct number_tag {};
template < number_kind Number >
number_type_data_ptr number_type_data::get_static() {
static number_type_data_ptr data = std::make_shared<number_type_data>(type_list<Number>{});
return data;
}
template < number_kind Number >
// NOLINTNEXTLINE(readability-named-parameter)
number_type_data::number_type_data(type_list<Number>)
: type_data_base{type_id{type_list<number_tag<Number>>{}}, type_kind::number_}
, flags{number_traits<Number>::make_flags()}
, size{number_traits<Number>::size} {}
template < number_kind Number >
number_type_data_ptr number_type_data::get_static() {
static number_type_data_ptr data = std::make_shared<number_type_data>(type_list<Number>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,18 +16,18 @@ namespace meta_hpp::detail
template < pointer_kind Pointer >
struct pointer_tag {};
template < pointer_kind Pointer >
pointer_type_data_ptr pointer_type_data::get_static() {
static pointer_type_data_ptr data = std::make_shared<pointer_type_data>(type_list<Pointer>{});
return data;
}
template < pointer_kind Pointer >
// NOLINTNEXTLINE(readability-named-parameter)
pointer_type_data::pointer_type_data(type_list<Pointer>)
: type_data_base{type_id{type_list<pointer_tag<Pointer>>{}}, type_kind::pointer_}
, flags{pointer_traits<Pointer>::make_flags()}
, data_type{resolve_type<typename pointer_traits<Pointer>::data_type>()} {}
template < pointer_kind Pointer >
pointer_type_data_ptr pointer_type_data::get_static() {
static pointer_type_data_ptr data = std::make_shared<pointer_type_data>(type_list<Pointer>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,18 +16,18 @@ namespace meta_hpp::detail
template < reference_kind Reference >
struct reference_tag {};
template < reference_kind Reference >
reference_type_data_ptr reference_type_data::get_static() {
static reference_type_data_ptr data = std::make_shared<reference_type_data>(type_list<Reference>{});
return data;
}
template < reference_kind Reference >
// NOLINTNEXTLINE(readability-named-parameter)
reference_type_data::reference_type_data(type_list<Reference>)
: type_data_base{type_id{type_list<reference_tag<Reference>>{}}, type_kind::reference_}
, flags{reference_traits<Reference>::make_flags()}
, data_type{resolve_type<typename reference_traits<Reference>::data_type>()} {}
template < reference_kind Reference >
reference_type_data_ptr reference_type_data::get_static() {
static reference_type_data_ptr data = std::make_shared<reference_type_data>(type_list<Reference>{});
return data;
}
}
namespace meta_hpp

View File

@@ -16,17 +16,17 @@ namespace meta_hpp::detail
template < void_kind Void >
struct void_tag {};
template < void_kind Void >
void_type_data_ptr void_type_data::get_static() {
static void_type_data_ptr data = std::make_shared<void_type_data>(type_list<Void>{});
return data;
}
template < void_kind Void >
// NOLINTNEXTLINE(readability-named-parameter)
void_type_data::void_type_data(type_list<Void>)
: type_data_base{type_id{type_list<void_tag<Void>>{}}, type_kind::void_}
, flags{void_traits<Void>::make_flags()} {}
template < void_kind Void >
void_type_data_ptr void_type_data::get_static() {
static void_type_data_ptr data = std::make_shared<void_type_data>(type_list<Void>{});
return data;
}
}
namespace meta_hpp