@@ -138,31 +138,30 @@ template<typename Type, typename Other>
138138struct uses_allocator_construction <std::pair<Type, Other>> {
139139 using type = std::pair<Type, Other>;
140140
141- template <typename Allocator, typename First, typename Second>
142- static constexpr auto args (const Allocator &allocator, std::piecewise_construct_t , First &&first, Second &&second) noexcept {
141+ template <typename First, typename Second>
142+ static constexpr auto args (const auto &allocator, std::piecewise_construct_t , First &&first, Second &&second) noexcept {
143143 return std::make_tuple (
144144 std::piecewise_construct,
145145 std::apply ([&allocator](auto &&...curr ) { return uses_allocator_construction<Type>::args (allocator, std::forward<decltype (curr)>(curr)...); }, std::forward<First>(first)),
146146 std::apply ([&allocator](auto &&...curr ) { return uses_allocator_construction<Other>::args (allocator, std::forward<decltype (curr)>(curr)...); }, std::forward<Second>(second)));
147147 }
148148
149- template <typename Allocator>
150- static constexpr auto args (const Allocator &allocator) noexcept {
149+ static constexpr auto args (const auto &allocator) noexcept {
151150 return uses_allocator_construction<type>::args (allocator, std::piecewise_construct, std::tuple<>{}, std::tuple<>{});
152151 }
153152
154- template <typename Allocator, typename First, typename Second>
155- static constexpr auto args (const Allocator &allocator, First &&first, Second &&second) noexcept {
153+ template <typename First, typename Second>
154+ static constexpr auto args (const auto &allocator, First &&first, Second &&second) noexcept {
156155 return uses_allocator_construction<type>::args (allocator, std::piecewise_construct, std::forward_as_tuple (std::forward<First>(first)), std::forward_as_tuple (std::forward<Second>(second)));
157156 }
158157
159- template <typename Allocator, typename First, typename Second>
160- static constexpr auto args (const Allocator &allocator, const std::pair<First, Second> &value) noexcept {
158+ template <typename First, typename Second>
159+ static constexpr auto args (const auto &allocator, const std::pair<First, Second> &value) noexcept {
161160 return uses_allocator_construction<type>::args (allocator, std::piecewise_construct, std::forward_as_tuple (value.first ), std::forward_as_tuple (value.second ));
162161 }
163162
164- template <typename Allocator, typename First, typename Second>
165- static constexpr auto args (const Allocator &allocator, std::pair<First, Second> &&value) noexcept {
163+ template <typename First, typename Second>
164+ static constexpr auto args (const auto &allocator, std::pair<First, Second> &&value) noexcept {
166165 return uses_allocator_construction<type>::args (allocator, std::piecewise_construct, std::forward_as_tuple (std::move (value.first )), std::forward_as_tuple (std::move (value.second )));
167166 }
168167};
@@ -177,14 +176,13 @@ struct uses_allocator_construction<std::pair<Type, Other>> {
177176 * create an object of a given type by means of uses-allocator construction.
178177 *
179178 * @tparam Type Type to return arguments for.
180- * @tparam Allocator Type of allocator used to manage memory and elements.
181179 * @tparam Args Types of arguments to use to construct the object.
182180 * @param allocator The allocator to use.
183181 * @param args Parameters to use to construct the object.
184182 * @return The arguments needed to create an object of the given type.
185183 */
186- template <typename Type, typename Allocator, typename ... Args>
187- constexpr auto uses_allocator_construction_args (const Allocator &allocator, Args &&...args) noexcept {
184+ template <typename Type, typename ... Args>
185+ constexpr auto uses_allocator_construction_args (const auto &allocator, Args &&...args) noexcept {
188186 return internal::uses_allocator_construction<Type>::args (allocator, std::forward<Args>(args)...);
189187}
190188
@@ -195,14 +193,13 @@ constexpr auto uses_allocator_construction_args(const Allocator &allocator, Args
195193 * means of uses-allocator construction.
196194 *
197195 * @tparam Type Type of object to create.
198- * @tparam Allocator Type of allocator used to manage memory and elements.
199196 * @tparam Args Types of arguments to use to construct the object.
200197 * @param allocator The allocator to use.
201198 * @param args Parameters to use to construct the object.
202199 * @return A newly created object of the given type.
203200 */
204- template <typename Type, typename Allocator, typename ... Args>
205- constexpr Type make_obj_using_allocator (const Allocator &allocator, Args &&...args) {
201+ template <typename Type, typename ... Args>
202+ constexpr Type make_obj_using_allocator (const auto &allocator, Args &&...args) {
206203 return std::make_from_tuple<Type>(internal::uses_allocator_construction<Type>::args (allocator, std::forward<Args>(args)...));
207204}
208205
@@ -213,15 +210,14 @@ constexpr Type make_obj_using_allocator(const Allocator &allocator, Args &&...ar
213210 * means of uses-allocator construction at an uninitialized memory location.
214211 *
215212 * @tparam Type Type of object to create.
216- * @tparam Allocator Type of allocator used to manage memory and elements.
217213 * @tparam Args Types of arguments to use to construct the object.
218214 * @param value Memory location in which to place the object.
219215 * @param allocator The allocator to use.
220216 * @param args Parameters to use to construct the object.
221217 * @return A pointer to the newly created object of the given type.
222218 */
223- template <typename Type, typename Allocator, typename ... Args>
224- constexpr Type *uninitialized_construct_using_allocator (Type *value, const Allocator &allocator, Args &&...args) {
219+ template <typename Type, typename ... Args>
220+ constexpr Type *uninitialized_construct_using_allocator (Type *value, const auto &allocator, Args &&...args) {
225221 return std::apply ([value](auto &&...curr ) { return ::new (value) Type (std::forward<decltype (curr)>(curr)...); }, internal::uses_allocator_construction<Type>::args (allocator, std::forward<Args>(args)...));
226222}
227223
0 commit comments