3232
3333namespace hud
3434{
35-
3635 /* *
3736 * This class couples together a pair of components, which may be of different types (first_type and second_type). The individual components can be accessed through its public members first and second.
3837 * pair is a particular case of Tuple.
@@ -58,8 +57,7 @@ namespace hud
5857 * If one of the component is explicitly default constructible, the pair is explicitly default constructible.
5958 * pair do not accept throwable default constructible components.
6059 */
61- constexpr explicit (!(hud::is_implicitly_default_constructible_v<first_type> && hud::is_implicitly_default_constructible_v<second_type>))
62- pair() noexcept
60+ constexpr explicit (!(hud::is_implicitly_default_constructible_v<first_type> && hud::is_implicitly_default_constructible_v<second_type>)) pair() noexcept
6361 : first()
6462 , second()
6563 {
@@ -76,8 +74,7 @@ namespace hud
7674 * @param f An object of the same type as 'first' or some other type implicitly convertible to it.
7775 * @param s An object of the same type as 'second' or some other type implicitly convertible to it.
7876 */
79- constexpr explicit (!(hud::is_convertible_v<const first_type &, first_type> && hud::is_convertible_v<const second_type &, second_type>))
80- pair(const first_type &f, const second_type &s) noexcept
77+ constexpr explicit (!(hud::is_convertible_v<const first_type &, first_type> && hud::is_convertible_v<const second_type &, second_type>)) pair(const first_type &f, const second_type &s) noexcept
8178 requires(hud::is_copy_constructible_v<first_type> && hud::is_copy_constructible_v<second_type>)
8279 : first(f)
8380 , second(s)
@@ -99,8 +96,7 @@ namespace hud
9996 */
10097 template <typename u_type_t = first_type, typename v_type_t = second_type>
10198 requires (hud::is_move_constructible_v<first_type, u_type_t > && hud::is_move_constructible_v<second_type, v_type_t >)
102- constexpr explicit (!(hud::is_convertible_v<u_type_t &&, first_type> && hud::is_convertible_v<v_type_t &&, second_type>))
103- pair(u_type_t &&f, v_type_t &&s) noexcept
99+ constexpr explicit (!(hud::is_convertible_v<u_type_t &&, first_type> && hud::is_convertible_v<v_type_t &&, second_type>)) pair(u_type_t &&f, v_type_t &&s) noexcept
104100 : first(hud::forward<u_type_t >(f))
105101 , second(hud::forward<v_type_t >(s))
106102 {
@@ -116,8 +112,7 @@ namespace hud
116112 * pair does not accept throwable copy constructible components.
117113 * @param other Another pair object.
118114 */
119- constexpr explicit (!(hud::is_convertible_v<const first_type &, first_type> && hud::is_convertible_v<const second_type &, second_type>))
120- pair(const pair &other) noexcept
115+ constexpr explicit (!(hud::is_convertible_v<const first_type &, first_type> && hud::is_convertible_v<const second_type &, second_type>)) pair(const pair &other) noexcept
121116 requires(hud::is_nothrow_copy_constructible_v<first_type> && hud::is_nothrow_copy_constructible_v<second_type>)
122117 = default;
123118
@@ -132,8 +127,7 @@ namespace hud
132127 */
133128 template <typename u_type_t , typename v_type_t >
134129 requires (hud::is_copy_constructible_v<first_type, u_type_t > && hud::is_copy_constructible_v<second_type, v_type_t >)
135- constexpr explicit (!(hud::is_convertible_v<const u_type_t &, first_type> && hud::is_convertible_v<const v_type_t &, second_type>))
136- pair(const pair<u_type_t , v_type_t > &other) noexcept
130+ constexpr explicit (!(hud::is_convertible_v<const u_type_t &, first_type> && hud::is_convertible_v<const v_type_t &, second_type>)) pair(const pair<u_type_t , v_type_t > &other) noexcept
137131 : first(other.first)
138132 , second(other.second)
139133 {
@@ -165,8 +159,7 @@ namespace hud
165159 */
166160 template <typename u_type_t , typename v_type_t >
167161 requires (hud::is_move_constructible_v<first_type, u_type_t > && hud::is_move_constructible_v<second_type, v_type_t >)
168- constexpr explicit (!(hud::is_convertible_v<u_type_t , first_type> && hud::is_convertible_v<v_type_t , second_type>))
169- pair(pair<u_type_t , v_type_t > &&other) noexcept
162+ constexpr explicit (!(hud::is_convertible_v<u_type_t , first_type> && hud::is_convertible_v<v_type_t , second_type>)) pair(pair<u_type_t , v_type_t > &&other) noexcept
170163 : first(hud::forward<u_type_t >(other.first))
171164 , second(hud::forward<v_type_t >(other.second))
172165 {
@@ -191,6 +184,22 @@ namespace hud
191184 return *this ;
192185 }
193186
187+ /* *
188+ * Destructor; Trivial if first_type and second_type are trivially destructible
189+ * This call first_type and second_type destructors.
190+ */
191+ constexpr ~pair ()
192+ requires (std::is_trivially_destructible_v<first_type> && std::is_trivially_destructible_v<second_type>)
193+ = default ;
194+
195+ /* *
196+ * Destructor; Trivial if first_type and second_type are trivially destructible
197+ * This call first_type and second_type destructors.
198+ */
199+ constexpr ~pair ()
200+ requires (!(std::is_trivially_destructible_v<first_type> && std::is_trivially_destructible_v<second_type>))
201+ = default ;
202+
194203 /* *
195204 * Assigns other as the new content for the pair object.
196205 * Perform copy assignments, with the elements of its argument preserving their values after the call.
0 commit comments