A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/algorithm/../ranges/../../cpp/memory/raw_storage_iterator.html below:

std::raw_storage_iterator - cppreference.com

std::raw_storage_iterator (until C++17)

template< class OutputIt, class T >
class raw_storage_iterator;

(since C++17)
(deprecated in C++17)
(removed in C++20)

The output iterator std::raw_storage_iterator makes it possible for standard algorithms to store results in uninitialized memory. Whenever the algorithm writes an object of type T to the dereferenced iterator, the object is copy-constructed into the location in the uninitialized storage pointed to by the iterator. The template parameter OutputIt is any type that meets the requirements of LegacyOutputIterator and has operator* defined to return an object, for which operator& returns an object of type T*. Usually, the type T* is used as OutputIt.

[edit] Type requirements [edit] Member functions [edit] Member types Member type Definition iterator_category std::output_iterator_tag value_type void difference_type pointer void reference void

Member types iterator_category, value_type, difference_type, pointer and reference are required to be obtained by inheriting from std::iterator<std::output_iterator_tag, void, void, void, void>.

(until C++17) [edit] Note

std::raw_storage_iterator was deprecated primarily because of its exception-unsafe behavior. Unlike std::uninitialized_copy, it doesn't handle exceptions during operations like std::copy safely, potentially leading to resource leaks due to a lack of tracking the number of successfully constructed objects and their proper destruction in the presence of exceptions.

[edit] Example [edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4