@@ -38,8 +38,7 @@ class meta_sequence_container {
3838 using iterator = meta_iterator;
3939
4040 /* ! @brief Default constructor. */
41- meta_sequence_container () noexcept
42- : meta_sequence_container{locator<meta_ctx>::value_or ()} {}
41+ meta_sequence_container () noexcept = default ;
4342
4443 /* *
4544 * @brief Context aware constructor.
@@ -82,7 +81,7 @@ class meta_sequence_container {
8281 [[nodiscard]] inline explicit operator bool () const noexcept ;
8382
8483private:
85- const meta_ctx *ctx{};
84+ const meta_ctx *ctx{&locator<meta_ctx>:: value_or () };
8685 internal::meta_type_node (*value_type_node)(const internal::meta_context &){};
8786 internal::meta_type_node (*const_reference_node)(const internal::meta_context &){};
8887 size_type (*size_fn)(const void *){};
@@ -108,8 +107,7 @@ class meta_associative_container {
108107 using iterator = meta_iterator;
109108
110109 /* ! @brief Default constructor. */
111- meta_associative_container () noexcept
112- : meta_associative_container{locator<meta_ctx>::value_or ()} {}
110+ meta_associative_container () noexcept = default ;
113111
114112 /* *
115113 * @brief Context aware constructor.
@@ -158,7 +156,7 @@ class meta_associative_container {
158156 [[nodiscard]] inline explicit operator bool () const noexcept ;
159157
160158private:
161- const meta_ctx *ctx{};
159+ const meta_ctx *ctx{&locator<meta_ctx>:: value_or () };
162160 internal::meta_type_node (*key_type_node)(const internal::meta_context &){};
163161 internal::meta_type_node (*mapped_type_node)(const internal::meta_context &){};
164162 internal::meta_type_node (*value_type_node)(const internal::meta_context &){};
@@ -228,18 +226,14 @@ class meta_any {
228226
229227public:
230228 /* ! Default constructor. */
231- meta_any () noexcept
232- : meta_any{meta_ctx_arg, locator<meta_ctx>::value_or ()} {}
229+ meta_any () noexcept = default ;
233230
234231 /* *
235232 * @brief Context aware constructor.
236233 * @param area The context from which to search for meta types.
237234 */
238235 meta_any (meta_ctx_arg_t , const meta_ctx &area) noexcept
239- : storage{},
240- ctx{&area},
241- node{},
242- vtable{&basic_vtable<void >} {}
236+ : ctx{&area} {}
243237
244238 /* *
245239 * @brief Constructs a wrapper by directly initializing the new object.
@@ -614,10 +608,10 @@ class meta_any {
614608 }
615609
616610private:
617- any storage;
618- const meta_ctx *ctx;
619- internal::meta_type_node node;
620- vtable_type *vtable;
611+ any storage{} ;
612+ const meta_ctx *ctx{&locator<meta_ctx>:: value_or ()} ;
613+ internal::meta_type_node node{} ;
614+ vtable_type *vtable{&basic_vtable< void >} ;
621615};
622616
623617/* *
@@ -651,8 +645,7 @@ template<typename Type>
651645 */
652646struct meta_handle {
653647 /* ! Default constructor. */
654- meta_handle () noexcept
655- : meta_handle{meta_ctx_arg, locator<meta_ctx>::value_or ()} {}
648+ meta_handle () noexcept = default ;
656649
657650 /* *
658651 * @brief Context aware constructor.
@@ -763,15 +756,13 @@ struct meta_handle {
763756 }
764757
765758private:
766- meta_any any;
759+ meta_any any{meta_ctx_arg, locator<meta_ctx>:: value_or ()} ;
767760};
768761
769762/* ! @brief Opaque wrapper for properties of any type. */
770763struct meta_prop {
771764 /* ! @brief Default constructor. */
772- meta_prop () noexcept
773- : node{},
774- ctx{} {}
765+ meta_prop () noexcept = default ;
775766
776767 /* *
777768 * @brief Context aware constructor for meta objects.
@@ -816,8 +807,8 @@ struct meta_prop {
816807 }
817808
818809private:
819- const internal::meta_prop_node *node;
820- const meta_ctx *ctx;
810+ const internal::meta_prop_node *node{} ;
811+ const meta_ctx *ctx{} ;
821812};
822813
823814/* *
@@ -836,9 +827,7 @@ struct meta_data {
836827 using size_type = typename internal::meta_data_node::size_type;
837828
838829 /* ! @brief Default constructor. */
839- meta_data () noexcept
840- : node{},
841- ctx{} {}
830+ meta_data () noexcept = default ;
842831
843832 /* *
844833 * @brief Context aware constructor for meta objects.
@@ -937,8 +926,8 @@ struct meta_data {
937926 }
938927
939928private:
940- const internal::meta_data_node *node;
941- const meta_ctx *ctx;
929+ const internal::meta_data_node *node{} ;
930+ const meta_ctx *ctx{} ;
942931};
943932
944933/* *
@@ -957,9 +946,7 @@ struct meta_func {
957946 using size_type = typename internal::meta_func_node::size_type;
958947
959948 /* ! @brief Default constructor. */
960- meta_func () noexcept
961- : node{},
962- ctx{} {}
949+ meta_func () noexcept = default ;
963950
964951 /* *
965952 * @brief Context aware constructor for meta objects.
@@ -1073,8 +1060,8 @@ struct meta_func {
10731060 }
10741061
10751062private:
1076- const internal::meta_func_node *node;
1077- const meta_ctx *ctx;
1063+ const internal::meta_func_node *node{} ;
1064+ const meta_ctx *ctx{} ;
10781065};
10791066
10801067/* *
@@ -1147,9 +1134,7 @@ class meta_type {
11471134 using size_type = typename internal::meta_type_node::size_type;
11481135
11491136 /* ! @brief Default constructor. */
1150- meta_type () noexcept
1151- : node{},
1152- ctx{} {}
1137+ meta_type () noexcept = default ;
11531138
11541139 /* *
11551140 * @brief Context aware constructor for meta objects.
@@ -1539,8 +1524,8 @@ class meta_type {
15391524 }
15401525
15411526private:
1542- internal::meta_type_node node;
1543- const meta_ctx *ctx;
1527+ internal::meta_type_node node{} ;
1528+ const meta_ctx *ctx{} ;
15441529};
15451530
15461531/* *
@@ -1647,11 +1632,7 @@ class meta_sequence_container::meta_iterator final {
16471632 using iterator_category = std::input_iterator_tag;
16481633 using iterator_concept = std::bidirectional_iterator_tag;
16491634
1650- meta_iterator () noexcept
1651- : meta_iterator{locator<meta_ctx>::value_or ()} {}
1652-
1653- meta_iterator (const meta_ctx &area) noexcept
1654- : ctx{&area} {}
1635+ meta_iterator () noexcept = default ;
16551636
16561637 template <typename It>
16571638 meta_iterator (const meta_ctx &area, It iter) noexcept
@@ -1708,7 +1689,7 @@ class meta_sequence_container::meta_iterator final {
17081689 }
17091690
17101691private:
1711- const meta_ctx *ctx{};
1692+ const meta_ctx *ctx{&locator<meta_ctx>:: value_or () };
17121693 vtable_type *vtable{};
17131694 any handle{};
17141695};
@@ -1738,11 +1719,7 @@ class meta_associative_container::meta_iterator final {
17381719 using iterator_category = std::input_iterator_tag;
17391720 using iterator_concept = std::forward_iterator_tag;
17401721
1741- meta_iterator () noexcept
1742- : meta_iterator{locator<meta_ctx>::value_or ()} {}
1743-
1744- meta_iterator (const meta_ctx &area) noexcept
1745- : ctx{&area} {}
1722+ meta_iterator () noexcept = default ;
17461723
17471724 template <bool KeyOnly, typename It>
17481725 meta_iterator (const meta_ctx &area, std::bool_constant<KeyOnly>, It iter) noexcept
@@ -1784,7 +1761,7 @@ class meta_associative_container::meta_iterator final {
17841761 }
17851762
17861763private:
1787- const meta_ctx *ctx{};
1764+ const meta_ctx *ctx{&locator<meta_ctx>:: value_or () };
17881765 vtable_type *vtable{};
17891766 any handle{};
17901767};
@@ -1861,7 +1838,7 @@ inline meta_sequence_container::iterator meta_sequence_container::insert(const i
18611838 return insert_fn (*ctx, const_cast <void *>(data), is_value_type ? std::as_const (value).data () : nullptr , is_value_type ? nullptr : std::as_const (value).data (), it);
18621839 }
18631840
1864- return iterator{*ctx };
1841+ return iterator{};
18651842}
18661843
18671844/* *
@@ -1870,7 +1847,7 @@ inline meta_sequence_container::iterator meta_sequence_container::insert(const i
18701847 * @return A possibly invalid iterator following the last removed element.
18711848 */
18721849inline meta_sequence_container::iterator meta_sequence_container::erase (const iterator &it) {
1873- return const_only ? iterator{*ctx } : erase_fn (*ctx, const_cast <void *>(data), it);
1850+ return const_only ? iterator{} : erase_fn (*ctx, const_cast <void *>(data), it);
18741851}
18751852
18761853/* *
@@ -1965,7 +1942,7 @@ inline meta_associative_container::size_type meta_associative_container::erase(m
19651942 * @return An iterator to the element with the given key, if any.
19661943 */
19671944[[nodiscard]] inline meta_associative_container::iterator meta_associative_container::find (meta_any key) {
1968- return key.allow_cast (meta_type{*ctx, key_type_node (internal::meta_context::from (*ctx))}) ? find_fn (*ctx, const_only ? nullptr : const_cast <void *>(data), data, std::as_const (key).data ()) : iterator{*ctx };
1945+ return key.allow_cast (meta_type{*ctx, key_type_node (internal::meta_context::from (*ctx))}) ? find_fn (*ctx, const_only ? nullptr : const_cast <void *>(data), data, std::as_const (key).data ()) : iterator{};
19691946}
19701947
19711948/* *
0 commit comments