diff --git a/dev/clang-format-all b/dev/clang-format-all index 879c9b3c..b8008334 100755 --- a/dev/clang-format-all +++ b/dev/clang-format-all @@ -1,3 +1,3 @@ #!/bin/bash -find include src examples tests docs.in -type f -name "*.?pp" | xargs clang-format -i +find include src examples tests -type f -name "*.?pp" | xargs clang-format -i diff --git a/include/yorel/yomm2/core.hpp b/include/yorel/yomm2/core.hpp index ebf180fb..fe7844b3 100644 --- a/include/yorel/yomm2/core.hpp +++ b/include/yorel/yomm2/core.hpp @@ -447,8 +447,7 @@ method::resolve(const ArgType&... args) const { if constexpr (arity == 1) { pf = resolve_uni, ArgType...>(args...); } else { - pf = resolve_multi_first<0, types, ArgType...>( - args...); + pf = resolve_multi_first<0, types, ArgType...>(args...); } return reinterpret_cast(pf); diff --git a/include/yorel/yomm2/detail.hpp b/include/yorel/yomm2/detail.hpp index c0da834e..a7a44d40 100644 --- a/include/yorel/yomm2/detail.hpp +++ b/include/yorel/yomm2/detail.hpp @@ -41,8 +41,7 @@ template type_id* type_id_list>::begin = value; template -type_id* type_id_list>::end = - value + sizeof...(T); +type_id* type_id_list>::end = value + sizeof...(T); template struct type_id_list> { @@ -136,14 +135,11 @@ template struct class_declaration_aux; template -struct class_declaration_aux> - : class_info { +struct class_declaration_aux> : class_info { class_declaration_aux() { this->type = collect_static_type_id(); - this->first_base = - type_id_list>::begin; - this->last_base = - type_id_list>::end; + this->first_base = type_id_list>::begin; + this->last_base = type_id_list>::end; Policy::classes.push_back(*this); this->is_abstract = std::is_abstract_v; this->static_vptr = &Policy::template static_vptr; @@ -336,8 +332,7 @@ constexpr bool is_virtual_ptr = is_virtual_ptr_aux::value; template using virtual_ptr_class = std::conditional_t< - sizeof...(Ts) == 2, - boost::mp11::mp_second>, + sizeof...(Ts) == 2, boost::mp11::mp_second>, boost::mp11::mp_first>>; template @@ -498,14 +493,12 @@ inline uintptr_t get_tip(const T& arg) { template using get_policy = std::conditional_t< is_policy>>, - boost::mp11::mp_back>, - YOMM2_DEFAULT_POLICY>; + boost::mp11::mp_back>, YOMM2_DEFAULT_POLICY>; template using remove_policy = std::conditional_t< is_policy>>, - boost::mp11::mp_pop_back>, - types>; + boost::mp11::mp_pop_back>, types>; template using virtual_ptr_policy = std::conditional_t< @@ -521,14 +514,10 @@ struct thunk; template< class Policy, typename BASE_RETURN, typename... BASE_PARAM, auto SPEC, typename... SPEC_PARAM> -struct thunk< - Policy, BASE_RETURN(BASE_PARAM...), SPEC, - types> { +struct thunk> { static BASE_RETURN fn(remove_virtual... arg) { - using base_type = - boost::mp11::mp_first>; - using spec_type = - boost::mp11::mp_first>; + using base_type = boost::mp11::mp_first>; + using spec_type = boost::mp11::mp_first>; return SPEC( argument_traits::template cast( remove_virtual(arg))...); @@ -562,8 +551,7 @@ struct member_function_thunk { template using inheritance_map = types, - types>, + boost::mp11::mp_bind_back, types>, Cs>...>; template @@ -575,33 +563,26 @@ struct use_classes_aux> { std::tuple, boost::mp11::mp_transform_q< boost::mp11::mp_bind_front, - boost::mp11::mp_apply< - inheritance_map, types>>>; + boost::mp11::mp_apply>>>; }; template -struct use_classes_aux< - Policy, - types, MoreClassLists...>> +struct use_classes_aux, MoreClassLists...>> : use_classes_aux< - Policy, - boost::mp11::mp_append< - types, MoreClassLists...>> + Policy, boost::mp11::mp_append, MoreClassLists...>> {}; template using second_last = boost::mp11::mp_at_c< - types, - boost::mp11::mp_size>::value - 2>; + types, boost::mp11::mp_size>::value - 2>; template using use_classes_macro = typename std::conditional_t< is_policy>, use_classes_aux< second_last, - boost::mp11::mp_pop_back< - boost::mp11::mp_pop_back>>>, + boost::mp11::mp_pop_back>>>, use_classes_aux< boost::mp11::mp_back>, boost::mp11::mp_pop_back>>>::type; diff --git a/include/yorel/yomm2/detail/compiler.hpp b/include/yorel/yomm2/detail/compiler.hpp index 2a3f6aa5..3cfe9afe 100644 --- a/include/yorel/yomm2/detail/compiler.hpp +++ b/include/yorel/yomm2/detail/compiler.hpp @@ -36,26 +36,20 @@ struct aggregate_reports; template struct aggregate_reports< - types, - types, + types, types, std::void_t> { using type = typename aggregate_reports< - types, - types>::type; + types, types>::type; }; template -struct aggregate_reports< - types, - types, Void> { +struct aggregate_reports, types, Void> { using type = typename aggregate_reports< - types, - types>::type; + types, types>::type; }; template -struct aggregate_reports< - types, types<>, Void> { +struct aggregate_reports, types<>, Void> { struct type : Reports... {}; }; @@ -241,9 +235,8 @@ struct compiler : detail::generic_compiler { using policy_type = Policy; using type_index_type = decltype(Policy::type_index(0)); - typename detail::aggregate_reports< - detail::types, typename Policy::facets>::type - report; + typename aggregate_reports< + types, typename Policy::facets>::type report; std::unordered_map class_map; diff --git a/include/yorel/yomm2/policies/basic_error_output.hpp b/include/yorel/yomm2/policies/basic_error_output.hpp index 9cdb8bbe..42143b2d 100644 --- a/include/yorel/yomm2/policies/basic_error_output.hpp +++ b/include/yorel/yomm2/policies/basic_error_output.hpp @@ -22,8 +22,8 @@ struct yOMM2_API_gcc basic_error_output : virtual error_output { template Stream basic_error_output::error_stream; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/basic_indirect_vptr.hpp b/include/yorel/yomm2/policies/basic_indirect_vptr.hpp index 2a872ba9..6a62b67a 100644 --- a/include/yorel/yomm2/policies/basic_indirect_vptr.hpp +++ b/include/yorel/yomm2/policies/basic_indirect_vptr.hpp @@ -22,8 +22,8 @@ template std::vector basic_indirect_vptr::indirect_vptrs; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/basic_trace_output.hpp b/include/yorel/yomm2/policies/basic_trace_output.hpp index 3d8deda1..58ae0378 100644 --- a/include/yorel/yomm2/policies/basic_trace_output.hpp +++ b/include/yorel/yomm2/policies/basic_trace_output.hpp @@ -28,8 +28,8 @@ bool basic_trace_output::trace_enabled([]() { return env && *env++ == '1' && *env++ == 0; }()); -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/fast_perfect_hash.hpp b/include/yorel/yomm2/policies/fast_perfect_hash.hpp index c4ee7c62..63923460 100644 --- a/include/yorel/yomm2/policies/fast_perfect_hash.hpp +++ b/include/yorel/yomm2/policies/fast_perfect_hash.hpp @@ -195,8 +195,8 @@ struct yOMM2_API_gcc checked_perfect_hash : virtual fast_perfect_hash, template std::vector checked_perfect_hash::control; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/minimal_rtti.hpp b/include/yorel/yomm2/policies/minimal_rtti.hpp index 8cfebcac..e1bcdf2f 100644 --- a/include/yorel/yomm2/policies/minimal_rtti.hpp +++ b/include/yorel/yomm2/policies/minimal_rtti.hpp @@ -21,8 +21,8 @@ struct minimal_rtti : virtual rtti { } }; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/std_rtti.hpp b/include/yorel/yomm2/policies/std_rtti.hpp index 95309d59..035020cf 100644 --- a/include/yorel/yomm2/policies/std_rtti.hpp +++ b/include/yorel/yomm2/policies/std_rtti.hpp @@ -50,8 +50,8 @@ struct std_rtti : virtual rtti { #endif }; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/throw_error.hpp b/include/yorel/yomm2/policies/throw_error.hpp index 20c6a004..d7275cfe 100644 --- a/include/yorel/yomm2/policies/throw_error.hpp +++ b/include/yorel/yomm2/policies/throw_error.hpp @@ -18,8 +18,8 @@ struct yOMM2_API_gcc throw_error : virtual error_handler { } }; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/vectored_error.hpp b/include/yorel/yomm2/policies/vectored_error.hpp index 6da609eb..5bebab80 100644 --- a/include/yorel/yomm2/policies/vectored_error.hpp +++ b/include/yorel/yomm2/policies/vectored_error.hpp @@ -64,8 +64,8 @@ error_handler_type vectored_error::error = std::is_same_v, vectored_error, DefaultHandlerProvider>::default_error_handler; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/vptr_map.hpp b/include/yorel/yomm2/policies/vptr_map.hpp index e5b60435..34ee8f04 100644 --- a/include/yorel/yomm2/policies/vptr_map.hpp +++ b/include/yorel/yomm2/policies/vptr_map.hpp @@ -38,8 +38,8 @@ struct yOMM2_API_gcc vptr_map : virtual external_vptr { template Map vptr_map::vptrs; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif diff --git a/include/yorel/yomm2/policies/vptr_vector.hpp b/include/yorel/yomm2/policies/vptr_vector.hpp index 5689396c..9cfe2648 100644 --- a/include/yorel/yomm2/policies/vptr_vector.hpp +++ b/include/yorel/yomm2/policies/vptr_vector.hpp @@ -78,8 +78,8 @@ struct yOMM2_API_gcc vptr_vector : virtual external_vptr { template std::vector vptr_vector::vptrs; -} -} -} +} // namespace policy +} // namespace yomm2 +} // namespace yorel #endif