proxygen
WhenN.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <iterator>
19 #include <memory>
20 #include <type_traits>
21 #include <utility>
22 #include <vector>
23 
25 
26 namespace folly {
27 namespace fibers {
28 
41 template <class InputIterator>
42 typename std::vector<
43  typename std::enable_if<
44  !std::is_same<
46  typename std::iterator_traits<InputIterator>::value_type>,
47  void>::value,
48  typename std::pair<
49  size_t,
51  typename std::iterator_traits<InputIterator>::value_type>>>::
52  type> inline collectN(InputIterator first, InputIterator last, size_t n);
53 
63 template <class InputIterator>
64 typename std::enable_if<
65  std::is_same<
67  typename std::iterator_traits<InputIterator>::value_type>,
68  void>::value,
69  std::vector<size_t>>::
70  type inline collectN(InputIterator first, InputIterator last, size_t n);
71 
83 template <class InputIterator>
84 typename std::vector<
85  typename std::enable_if<
86  !std::is_same<
88  typename std::iterator_traits<InputIterator>::value_type>,
89  void>::value,
91  typename std::iterator_traits<InputIterator>::value_type>>::
92  type> inline collectAll(InputIterator first, InputIterator last);
93 
100 template <class InputIterator>
101 typename std::enable_if<
102  std::is_same<
104  typename std::iterator_traits<InputIterator>::value_type>,
105  void>::value,
106  void>::type inline collectAll(InputIterator first, InputIterator last);
107 
118 template <class InputIterator>
119 typename std::enable_if<
120  !std::is_same<
122  typename std::iterator_traits<InputIterator>::value_type>,
123  void>::value,
124  typename std::pair<
125  size_t,
127  typename std::iterator_traits<InputIterator>::value_type>>>::
128  type inline collectAny(InputIterator first, InputIterator last);
129 
138 template <class InputIterator>
139 typename std::enable_if<
140  std::is_same<
142  typename std::iterator_traits<InputIterator>::value_type>,
143  void>::value,
144  size_t>::type inline collectAny(InputIterator first, InputIterator last);
145 } // namespace fibers
146 } // namespace folly
147 
148 #include <folly/fibers/WhenN-inl.h>
std::enable_if< !std::is_same< invoke_result_t< typename std::iterator_traits< InputIterator >::value_type >, void >::value, typename std::pair< size_t, invoke_result_t< typename std::iterator_traits< InputIterator >::value_type > > >::type collectAny(InputIterator first, InputIterator last)
Definition: WhenN-inl.h:192
std::vector< typename std::enable_if< !std::is_same< invoke_result_t< typename std::iterator_traits< InputIterator >::value_type >, void >::value, invoke_result_t< typename std::iterator_traits< InputIterator >::value_type > >::type > collectAll(InputIterator first, InputIterator last)
Definition: WhenN-inl.h:147
typename invoke_result< F, Args... >::type invoke_result_t
Definition: Invoke.h:142
PskType type
std::vector< typename std::enable_if< !std::is_same< invoke_result_t< typename std::iterator_traits< InputIterator >::value_type >, void >::value, typename std::pair< size_t, invoke_result_t< typename std::iterator_traits< InputIterator >::value_type > > >::type > collectN(InputIterator first, InputIterator last, size_t n)
Definition: WhenN-inl.h:34
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
constexpr detail::First first
Definition: Base-inl.h:2553