folly::order_preserving_reinsertion_view_fn

Extension point yielding an order-preserving reinsertion view of a container.

Synopsis

Declared in <folly/container/View.h>

struct order_preserving_reinsertion_view_fn;

Description

Provides an order such that if entries are inserted into a new instance in that order, iteration order of the new instance matches the original's. This can be useful for containers that have defined but non-FIFO iteration order, such as F14Vector*.

Should return an iterable view (a type that provides begin() and end()).

Containers should provide overloads via tag-invoke.

Member Functions

NameDescription
operator() Returns the order-preserving reinsertion view for container.

Non-Member Functions

NameDescription
tag_invokeReturns a range that enumerates the set in order-preserving reinsertion order.
tag_invokeReturns a range that enumerates the set in order-preserving reinsertion order.
tag_invokeReturns a range that enumerates the map in order-preserving reinsertion order.