mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-14 11:40:35 +07:00
fix new clang-tidy warnings
This commit is contained in:
@@ -21,7 +21,6 @@ ConstructorInitializerIndentWidth: 0
|
||||
FixNamespaceComments: false
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
LambdaBodyIndentation: OuterScope
|
||||
NamespaceIndentation: All
|
||||
PackConstructorInitializers: Never
|
||||
PenaltyBreakAssignment: 100
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Diagnostics:
|
||||
UnusedIncludes: None
|
||||
MissingIncludes: None
|
||||
ClangTidy:
|
||||
Add:
|
||||
- bugprone-*
|
||||
@@ -20,7 +22,7 @@ Diagnostics:
|
||||
- misc-unused-using-decls
|
||||
- modernize-use-trailing-return-type
|
||||
- readability-identifier-length
|
||||
- readability-named-parameter``
|
||||
- readability-named-parameter
|
||||
- readability-redundant-access-specifiers
|
||||
- readability-simplify-boolean-expr
|
||||
- readability-use-anyofallof
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace meta_hpp::detail
|
||||
|
||||
public:
|
||||
template < typename F >
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
void for_each_scope(F&& f) const {
|
||||
const locker lock;
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace meta_hpp::detail
|
||||
|
||||
public:
|
||||
template < typename F >
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
void for_each_type(F&& f) const {
|
||||
const locker lock;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace meta_hpp::detail
|
||||
|
||||
template < typename T, typename Tp = std::decay_t<T> >
|
||||
requires(!uvalue_family<Tp>)
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
explicit uarg_base(type_registry& registry, T&&)
|
||||
: uarg_base{registry, type_list<T&&>{}} {}
|
||||
|
||||
@@ -57,6 +58,7 @@ namespace meta_hpp::detail
|
||||
: ref_type_{ref_types::const_lvalue}
|
||||
, raw_type_{v.get_type()} {}
|
||||
|
||||
// NOLINTNEXTLINE(*-param-not-moved)
|
||||
explicit uarg_base(type_registry&, uvalue&& v)
|
||||
: ref_type_{ref_types::rvalue}
|
||||
, raw_type_{v.get_type()} {}
|
||||
@@ -378,8 +380,8 @@ namespace meta_hpp::detail
|
||||
template < typename ArgTypeList, typename F >
|
||||
auto unchecked_call_with_uargs(type_registry& registry, std::span<const uarg> args, F&& f) {
|
||||
META_HPP_DEV_ASSERT(args.size() == type_list_arity_v<ArgTypeList>);
|
||||
return [args, ®istry, &f]<std::size_t... Is>(std::index_sequence<Is...>) {
|
||||
return f(args[Is].cast<type_list_at_t<Is, ArgTypeList>>(registry)...);
|
||||
}(std::make_index_sequence<type_list_arity_v<ArgTypeList>>());
|
||||
return [args, ®istry]<std::size_t... Is>(auto&& captured_f, std::index_sequence<Is...>) {
|
||||
return std::invoke(META_HPP_FWD(captured_f), args[Is].cast<type_list_at_t<Is, ArgTypeList>>(registry)...);
|
||||
}(META_HPP_FWD(f), std::make_index_sequence<type_list_arity_v<ArgTypeList>>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace meta_hpp::detail
|
||||
|
||||
template < typename T, typename Tp = std::decay_t<T> >
|
||||
requires(!uvalue_family<Tp>)
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
explicit uinst_base(type_registry& registry, T&&)
|
||||
: uinst_base{registry, type_list<T&&>{}} {}
|
||||
|
||||
@@ -57,6 +58,7 @@ namespace meta_hpp::detail
|
||||
: ref_type_{ref_types::const_lvalue}
|
||||
, raw_type_{v.get_type()} {}
|
||||
|
||||
// NOLINTNEXTLINE(*-param-not-moved)
|
||||
explicit uinst_base(type_registry&, uvalue&& v)
|
||||
: ref_type_{ref_types::rvalue}
|
||||
, raw_type_{v.get_type()} {}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
namespace meta_hpp
|
||||
{
|
||||
template < type_family Type = any_type, typename F >
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
void for_each_type(F&& f) {
|
||||
using namespace detail;
|
||||
type_registry& registry = type_registry::instance();
|
||||
@@ -35,6 +36,7 @@ namespace meta_hpp
|
||||
}
|
||||
|
||||
template < typename T >
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
[[nodiscard]] auto resolve_type(T&&) {
|
||||
using namespace detail;
|
||||
type_registry& registry = type_registry::instance();
|
||||
@@ -59,6 +61,7 @@ namespace meta_hpp
|
||||
namespace meta_hpp
|
||||
{
|
||||
template < typename T >
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
[[nodiscard]] auto resolve_poly_type(T&& from) {
|
||||
using namespace detail;
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace meta_hpp
|
||||
|
||||
template < typename To, typename From >
|
||||
requires detail::lvalue_reference_ucast_kind<To, From>
|
||||
// NOLINTNEXTLINE(*-missing-std-forward)
|
||||
To ucast(From&& from) {
|
||||
using from_data_type = std::remove_reference_t<From>;
|
||||
using to_data_type = std::remove_reference_t<To>;
|
||||
|
||||
@@ -129,6 +129,7 @@ namespace meta_hpp
|
||||
external,
|
||||
};
|
||||
|
||||
// NOLINTNEXTLINE(*-union-access)
|
||||
struct storage_u final {
|
||||
union {
|
||||
internal_storage_t internal;
|
||||
|
||||
@@ -162,6 +162,7 @@ namespace meta_hpp
|
||||
static vtable_t table{
|
||||
.type = resolve_type<Tp>(),
|
||||
|
||||
// NOLINTNEXTLINE(*-param-not-moved)
|
||||
.move{[](uvalue&& self, uvalue& to) noexcept {
|
||||
META_HPP_DEV_ASSERT(!to);
|
||||
META_HPP_DEV_ASSERT(self);
|
||||
|
||||
Reference in New Issue
Block a user