Skip to content
Snippets Groups Projects
Commit 55ae6162 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

allow to compare tuple of two elements and pair

parent 05e61d69
No related branches found
No related tags found
1 merge request!80Merge jt
Pipeline #35766 passed
...@@ -237,6 +237,16 @@ struct tuple_element < I, ext::tuple < Types... > > { ...@@ -237,6 +237,16 @@ struct tuple_element < I, ext::tuple < Types... > > {
typedef typename std::tuple_element < I, std::tuple < Types ... > >::type type; typedef typename std::tuple_element < I, std::tuple < Types ... > >::type type;
}; };
   
template < class T1, class T2, class T3, class T4 >
inline constexpr bool operator < ( const std::pair < T1, T2 > & first, const std::tuple < T3, T4 > & second ) {
return std::tie ( first.first, first.second ) < second;
}
template < class T1, class T2, class T3, class T4 >
inline constexpr bool operator < ( const std::tuple < T1, T2 > & first, const std::pair < T3, T4 > & second ) {
return first < std::tie ( second.first, second.second ) ;
}
} /* namespace ext */ } /* namespace ext */
   
#endif /* __TUPLE_HPP_ */ #endif /* __TUPLE_HPP_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment