template<class Selector, class Comparer>
class folly::gen::detail::Min< Selector, Comparer >
Min - For a value which minimizes a key, where the key is determined by a given selector, and compared by given comparer.
This type is usually used through the singletone 'min' or through the helper functions 'minBy' and 'maxBy'.
auto oldest = from(people) | minBy([](Person& p) { return p.dateOfBirth; });
Definition at line 2213 of file Base-inl.h.
template<class Selector , class Comparer >
template<class Value , class Source , class StorageType = typename std::decay<Value>::type, class Key = typename std::decay<invoke_result_t<Selector, Value>>::type>
Definition at line 2235 of file Base-inl.h.
References folly::Optional< Value >::get_pointer(), min, folly::gen::move, v, and testing::Value().
2238 "Calling min or max on an infinite source will cause " 2239 "an infinite loop.");
2240 Optional<StorageType>
min;
2241 Optional<Key> minKey;
2244 if (
auto lastKey = minKey.get_pointer()) {
2250 min = std::forward<Value>(
v);
constexpr detail::Map< Move > move
internal::KeyMatcher< M > Key(M inner_matcher)
constexpr detail::Min< Identity, Less > min
const T & asConst(const T &t) const
bool Value(const T &value, M matcher)