proxygen
folly::presorted_t Struct Reference

#include <Utility.h>

Detailed Description

A generic tag type to indicate that some constructor or method accepts a presorted container.

Example:

void takes_numbers(std::vector<int> alist) { std::sort(alist.begin(), alist.end()); takes_numbers(folly::presorted, alist); }

void takes_numbers(folly::presorted_t, std::vector<int> alist) { assert(std::is_sorted(alist.begin(), alist.end())); // debug mode only for (i : alist) { // some behavior which is defined and safe only when alist is sorted ... } }

Definition at line 310 of file Utility.h.


The documentation for this struct was generated from the following file: