22 #include <type_traits> 85 template <
typename Range,
typename Func>
93 namespace for_each_detail {
121 template <
typename Sequence,
typename Index>
134 #define _FE_ANON(x) FB_CONCATENATE(FOR_EACH_, FB_CONCATENATE(x, __LINE__)) 143 #define FOR_EACH(i, c) \ 144 if (bool _FE_ANON(s1_) = false) { \ 146 for (auto&& _FE_ANON(s2_) = (c); !_FE_ANON(s1_); _FE_ANON(s1_) = true) \ 147 for (auto i = _FE_ANON(s2_).begin(); i != _FE_ANON(s2_).end(); ++i) 156 #define FOR_EACH_R(i, c) \ 157 if (bool _FE_ANON(s1_) = false) { \ 159 for (auto&& _FE_ANON(s2_) = (c); !_FE_ANON(s1_); _FE_ANON(s1_) = true) \ 160 for (auto i = _FE_ANON(s2_).rbegin(); i != _FE_ANON(s2_).rend(); ++i) 170 #define FOR_EACH_ENUMERATE(count, i, c) \ 171 if (bool _FE_ANON(s1_) = false) { \ 173 for (auto&& FOR_EACH_state2 = (c); !_FE_ANON(s1_); _FE_ANON(s1_) = true) \ 174 if (size_t _FE_ANON(n1_) = 0) { \ 175 } else if (const size_t& count = _FE_ANON(n1_)) { \ 177 for (auto i = FOR_EACH_state2.begin(); i != FOR_EACH_state2.end(); \ 178 ++_FE_ANON(n1_), ++i) 197 #define FOR_EACH_KV(k, v, c) \ 198 if (unsigned int _FE_ANON(s1_) = 0) { \ 200 for (auto&& _FE_ANON(s2_) = (c); !_FE_ANON(s1_); _FE_ANON(s1_) = 1) \ 201 for (auto _FE_ANON(s3_) = _FE_ANON(s2_).begin(); \ 202 _FE_ANON(s3_) != _FE_ANON(s2_).end(); \ 203 _FE_ANON(s1_) == 2 ? ((_FE_ANON(s1_) = 0), ++_FE_ANON(s3_)) \ 204 : (_FE_ANON(s3_) = _FE_ANON(s2_).end())) \ 205 for (auto& k = _FE_ANON(s3_)->first; !_FE_ANON(s1_); ++_FE_ANON(s1_)) \ 206 for (auto& v = _FE_ANON(s3_)->second; !_FE_ANON(s1_); ++_FE_ANON(s1_)) 212 template <
typename T,
typename U>
217 template <
typename C,
typename D>
218 static char test(decltype(
C() <
D())*);
219 template <
typename,
typename>
223 enum {
value =
sizeof(test<T, U>(
nullptr)) == 1 };
248 template <
class T,
class U>
254 template <
class T,
class U>
262 template <
class T,
class U>
263 typename std::enable_if<
271 template <
class T,
class U>
272 typename std::enable_if<
286 template <
class T,
class U>
290 return begin < iter--;
293 template <
class T,
class U>
313 #define FOR_EACH_RANGE(i, begin, end) \ 314 for (auto i = (true ? (begin) : (end)); \ 315 ::folly::detail::notThereYet(i, (end)); \ 324 #define FOR_EACH_RANGE_R(i, begin, end) \ 325 for (auto i = (false ? (begin) : (end)); ::folly::detail::downTo(i, (begin));) constexpr auto loop_continue
#define FOLLY_CPP14_CONSTEXPR
static uint64_t test(std::string name, bool fc_, bool dedicated_, bool tc_, bool syncops_, uint64_t base)
auto begin(TestAdlIterable &instance)
—— Concurrent Priority Queue Implementation ——
auto end(TestAdlIterable &instance)
constexpr Range< Iter > range(Iter first, Iter last)
static const char *const value
std::enable_if< !((std::is_arithmetic< T >::value &&std::is_arithmetic< U >::value)||(std::is_pointer< T >::value &&std::is_pointer< U >::value)), bool >::type notThereYet(T &iter, const U &end)
std::enable_if<!HasLess< U, T >::value, bool >::type downTo(T &iter, const U &begin)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
decltype(auto) FOLLY_CPP14_CONSTEXPR fetch(Sequence &&sequence, Index &&index)
constexpr auto loop_break
FOLLY_CPP14_CONSTEXPR Func for_each(Sequence &&sequence, Func func)