[specialized.destroy] (original) (raw)
26 Algorithms library [algorithms]
26.11 Specialized algorithms [specialized.algorithms]
26.11.9 destroy [specialized.destroy]
template<class T> constexpr void destroy_at(T* location);namespace ranges { template<[destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]") T> constexpr void destroy_at(T* location) noexcept;}
Effects:
- If T is an array type, equivalent todestroy(begin(*location), end(*location)).
- Otherwise, equivalent tolocation->~T().
template<class NoThrowForwardIterator> constexpr void destroy(NoThrowForwardIterator first, NoThrowForwardIterator last);
Effects: Equivalent to:for (; first != last; ++first) destroy_at(addressof(*first));
Effects: Equivalent to:for (; first != last; ++first) destroy_at(addressof(*first));return first;
template<class NoThrowForwardIterator, class Size> constexpr NoThrowForwardIterator destroy_n(NoThrowForwardIterator first, Size n);
Effects: Equivalent to:for (; n > 0; (void)++first, --n) destroy_at(addressof(*first));return first;
Effects: Equivalent to:return destroy(counted_iterator(std::move(first), n), default_sentinel).base();