proxygen
|
#include <Utility.h>
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 ... } }