Files
2025-10-25 03:02:53 +03:00

3.2 KiB
Raw Permalink Blame History

[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);

1

#

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.2Special memory concepts[special.mem.concepts]") I, [nothrow-sentinel-for](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2Special memory concepts[special.mem.concepts]")<I> S, class T> requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11Concept 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.2Special memory concepts[special.mem.concepts]") R, class T> requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11Concept constructible_­from[concept.constructible]")<range_value_t<R>, const T&> constexpr borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x); }

2

#

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);

3

#

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.2Special memory concepts[special.mem.concepts]") I, class T> requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11Concept 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); }

4

#

Effects: Equivalent to:return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base();