Virtual Testbed
Ship dynamics simulator for extreme conditions
vertex.hh
1 #ifndef VTESTBED_GEOMETRY_VERTEX_HH
2 #define VTESTBED_GEOMETRY_VERTEX_HH
3 
4 #include <vtestbed/geometry/types.hh>
5 
6 namespace vtb {
7 
8  namespace geometry {
9 
10  template <class T, int N>
11  struct Compare_vertex {
12 
13  using value_type = vtb::geometry::Vertex<T,N>;
14 
15  inline bool
16  operator()(const value_type& lhs, const value_type& rhs) const {
17  return std::lexicographical_compare(
18  lhs.data(), lhs.data()+N, rhs.data(), rhs.data()+N
19  );
20  }
21 
22  };
23 
24  template <class T, int N>
25  struct Equal_vertex {
26 
27  using value_type = vtb::geometry::Vertex<T,N>;
28 
29  inline bool
30  operator()(const value_type& lhs, const value_type& rhs) const {
31  return std::equal(lhs.data(), lhs.data()+N, rhs.data());
32  }
33 
34  };
35 
36  }
37 
38 }
39 
40 
41 #endif // vim:filetype=cpp
Main namespace.
Definition: convert.hh:9