mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-14 11:40:35 +07:00
remove meta_hpp::stdex namespace
This commit is contained in:
@@ -39,10 +39,11 @@
|
||||
#include "meta_base/cvref_traits.hpp"
|
||||
#include "meta_base/fixed_function.hpp"
|
||||
#include "meta_base/hash_combiner.hpp"
|
||||
#include "meta_base/is_in_place_type.hpp"
|
||||
#include "meta_base/noncopyable.hpp"
|
||||
#include "meta_base/overloaded.hpp"
|
||||
#include "meta_base/select_overload.hpp"
|
||||
#include "meta_base/stdex.hpp"
|
||||
#include "meta_base/to_underlying.hpp"
|
||||
#include "meta_base/type_id.hpp"
|
||||
#include "meta_base/type_kinds.hpp"
|
||||
#include "meta_base/type_list.hpp"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace meta_hpp::stdex
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename T >
|
||||
struct is_in_place_type : std::false_type {};
|
||||
@@ -20,11 +20,3 @@ namespace meta_hpp::stdex
|
||||
template < typename T >
|
||||
inline constexpr bool is_in_place_type_v = is_in_place_type<T>::value;
|
||||
}
|
||||
|
||||
namespace meta_hpp::stdex
|
||||
{
|
||||
template < typename Enum >
|
||||
[[nodiscard]] constexpr std::underlying_type_t<Enum> to_underlying(Enum e) noexcept {
|
||||
return static_cast<std::underlying_type_t<Enum>>(e);
|
||||
}
|
||||
}
|
||||
17
headers/meta.hpp/meta_base/to_underlying.hpp
Normal file
17
headers/meta.hpp/meta_base/to_underlying.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* 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-2022, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace meta_hpp::detail
|
||||
{
|
||||
template < typename Enum >
|
||||
[[nodiscard]] constexpr std::underlying_type_t<Enum> to_underlying(Enum e) noexcept {
|
||||
return static_cast<std::underlying_type_t<Enum>>(e);
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ namespace meta_hpp::detail
|
||||
|
||||
template < class_kind Class, typename... Args >
|
||||
argument_list make_constructor_arguments() {
|
||||
using ct = detail::constructor_traits<Class, Args...>;
|
||||
using ct = constructor_traits<Class, Args...>;
|
||||
using ct_argument_types = typename ct::argument_types;
|
||||
|
||||
argument_list arguments;
|
||||
@@ -95,8 +95,8 @@ namespace meta_hpp::detail
|
||||
|
||||
[&arguments]<std::size_t... Is>(std::index_sequence<Is...>) mutable {
|
||||
[[maybe_unused]] const auto make_argument = []<std::size_t I>(std::index_sequence<I>){
|
||||
using P = detail::type_list_at_t<I, ct_argument_types>;
|
||||
return argument{detail::argument_state::make<P>(I, metadata_map{})};
|
||||
using P = type_list_at_t<I, ct_argument_types>;
|
||||
return argument{argument_state::make<P>(I, metadata_map{})};
|
||||
};
|
||||
(arguments.push_back(make_argument(std::index_sequence<Is>{})), ...);
|
||||
}(std::make_index_sequence<ct::arity>());
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace meta_hpp::detail
|
||||
.index{evalue_index::make<Enum>(std::move(name))},
|
||||
.metadata{std::move(metadata)},
|
||||
.enum_value{uvalue{evalue}},
|
||||
.underlying_value{uvalue{stdex::to_underlying(evalue)}},
|
||||
.underlying_value{uvalue{to_underlying(evalue)}},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace meta_hpp::detail
|
||||
|
||||
template < function_kind Function >
|
||||
argument_list make_function_arguments() {
|
||||
using ft = detail::function_traits<Function>;
|
||||
using ft = function_traits<Function>;
|
||||
using ft_argument_types = typename ft::argument_types;
|
||||
|
||||
argument_list arguments;
|
||||
@@ -103,8 +103,8 @@ namespace meta_hpp::detail
|
||||
|
||||
[&arguments]<std::size_t... Is>(std::index_sequence<Is...>) mutable {
|
||||
[[maybe_unused]] const auto make_argument = []<std::size_t I>(std::index_sequence<I>){
|
||||
using P = detail::type_list_at_t<I, ft_argument_types>;
|
||||
return argument{detail::argument_state::make<P>(I, metadata_map{})};
|
||||
using P = type_list_at_t<I, ft_argument_types>;
|
||||
return argument{argument_state::make<P>(I, metadata_map{})};
|
||||
};
|
||||
(arguments.push_back(make_argument(std::index_sequence<Is>{})), ...);
|
||||
}(std::make_index_sequence<ft::arity>());
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace meta_hpp::detail
|
||||
|
||||
template < method_kind Method >
|
||||
argument_list make_method_arguments() {
|
||||
using mt = detail::method_traits<Method>;
|
||||
using mt = method_traits<Method>;
|
||||
using mt_argument_types = typename mt::argument_types;
|
||||
|
||||
argument_list arguments;
|
||||
@@ -114,8 +114,8 @@ namespace meta_hpp::detail
|
||||
|
||||
[&arguments]<std::size_t... Is>(std::index_sequence<Is...>) mutable {
|
||||
[[maybe_unused]] const auto make_argument = []<std::size_t I>(std::index_sequence<I>){
|
||||
using P = detail::type_list_at_t<I, mt_argument_types>;
|
||||
return argument{detail::argument_state::make<P>(I, metadata_map{})};
|
||||
using P = type_list_at_t<I, mt_argument_types>;
|
||||
return argument{argument_state::make<P>(I, metadata_map{})};
|
||||
};
|
||||
(arguments.push_back(make_argument(std::index_sequence<Is>{})), ...);
|
||||
}(std::make_index_sequence<mt::arity>());
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace meta_hpp
|
||||
|
||||
template < detail::decay_non_value_kind T >
|
||||
requires std::is_copy_constructible_v<std::decay_t<T>>
|
||||
&& (!stdex::is_in_place_type_v<std::remove_cvref_t<T>>)
|
||||
&& (!detail::is_in_place_type_v<std::remove_cvref_t<T>>)
|
||||
// NOLINTNEXTLINE(*-forwarding-reference-overload)
|
||||
explicit uvalue(T&& val);
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace meta_hpp
|
||||
|
||||
template < detail::decay_non_value_kind T >
|
||||
requires std::is_copy_constructible_v<std::decay_t<T>>
|
||||
&& (!stdex::is_in_place_type_v<std::remove_cvref_t<T>>)
|
||||
&& (!detail::is_in_place_type_v<std::remove_cvref_t<T>>)
|
||||
// NOLINTNEXTLINE(*-forwarding-reference-overload)
|
||||
uvalue::uvalue(T&& val) {
|
||||
vtable_t::construct<T>(*this, std::forward<T>(val));
|
||||
|
||||
Reference in New Issue
Block a user