3.2 KiB
[uninitialized.fill]
26 Algorithms library [algorithms]
26.11 Specialized algorithms [specialized.algorithms]
26.11.7 uninitialized_fill [uninitialized.fill]
template<class NoThrowForwardIterator, class T> constexpr void uninitialized_fill(NoThrowForwardIterator first, NoThrowForwardIterator last, const T& x);
Effects: Equivalent to:for (; first != last; ++first)::new (voidify(*first))typename iterator_traits::value_type(x);
namespace ranges { template<[nothrow-forward-iterator](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [nothrow-sentinel-for](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]")<I> S, class T> requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<iter_value_t<I>, const T&> constexpr I uninitialized_fill(I first, S last, const T& x); template<[nothrow-forward-range](special.mem.concepts#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") R, class T> requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<range_value_t<R>, const T&> constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); }
Effects: Equivalent to:for (; first != last; ++first)::new (voidify(*first)) remove_reference_t<iter_reference_t>(x);return first;
template<class NoThrowForwardIterator, class Size, class T> constexpr NoThrowForwardIterator uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
Effects: Equivalent to:for (; n--; ++first)::new (voidify(*first))typename iterator_traits::value_type(x);return first;
namespace ranges { template<[nothrow-forward-iterator](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, class T> requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<iter_value_t<I>, const T&> constexpr I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x); }
Effects: Equivalent to:return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base();