DASH  0.3.0
SetIntersect.h
1 #ifndef DASH__VIEW__SET_INTERSECT_H__INCLUDED
2 #define DASH__VIEW__SET_INTERSECT_H__INCLUDED
3 
4 #include <dash/Types.h>
5 #include <dash/Range.h>
6 
7 #include <dash/view/Sub.h>
8 
9 
10 namespace dash {
11 
15 template <
16  class ViewTypeA,
17  class ViewTypeB >
18 constexpr auto
20  const ViewTypeA & va,
21  const ViewTypeB & vb)
22  -> decltype(dash::sub(0, 0, va))
23 {
24  return dash::sub(
25  dash::index(va).pre()[
26  std::max(
29  )
30  ],
31  dash::index(va).pre()[
32  std::min(
33  *dash::end(dash::index(va)),
35  )
36  ],
37  va
38  );
39 }
40 
41 } // namespace dash
42 
43 #endif // DASH__VIEW__SET_INTERSECT_H__INCLUDED
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98
constexpr auto intersect(const ViewTypeA &va, const ViewTypeB &vb) -> decltype(dash::sub(0, 0, va))
Definition: SetIntersect.h:19
This class is a simple memory pool which holds allocates elements of size ValueType.
Definition: AllOf.h:8
constexpr auto begin(RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
Definition: Range.h:89