Commit ddc11d67 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Canonical SFINAE in fibers

Summary: [Folly] Canonical SFINAE in fibers, where the `enable_if` is on the outside.

Reviewed By: andriigrynenko

Differential Revision: D14294993

fbshipit-source-id: 498c9bfcd346edb5e4b5b65941e2a09c93e870b6
parent 1cb1ad79
......@@ -22,15 +22,15 @@ namespace folly {
namespace fibers {
template <class InputIterator>
typename std::vector<typename std::enable_if<
typename std::enable_if<
!std::is_same<
invoke_result_t<
typename std::iterator_traits<InputIterator>::value_type>,
void>::value,
typename std::pair<
typename std::vector<typename std::pair<
size_t,
invoke_result_t<
typename std::iterator_traits<InputIterator>::value_type>>>::type>
typename std::iterator_traits<InputIterator>::value_type>>>>::type
collectN(InputIterator first, InputIterator last, size_t n) {
typedef invoke_result_t<
typename std::iterator_traits<InputIterator>::value_type>
......
......@@ -39,17 +39,16 @@ namespace fibers {
* @return vector of pairs (task index, return value of task)
*/
template <class InputIterator>
typename 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> inline collectN(InputIterator first, InputIterator last, size_t n);
typename std::enable_if<
!std::is_same<
invoke_result_t<
typename std::iterator_traits<InputIterator>::value_type>,
void>::value,
typename std::vector<typename std::pair<
size_t,
invoke_result_t<
typename std::iterator_traits<InputIterator>::value_type>>>>::
type inline collectN(InputIterator first, InputIterator last, size_t n);
/**
* collectN specialization for functions returning void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment