26 #ifndef MLN_CORE_ALIAS_POINT2D_HH
27 # define MLN_CORE_ALIAS_POINT2D_HH
34 # include <mln/core/point.hh>
36 # include <mln/core/concept/site_proxy.hh>
37 # include <mln/core/internal/force_exact.hh>
57 template <
typename C,
typename E>
58 struct subject_impl< const point<grid::square, C>, E >
63 typedef const C& row_t;
66 typedef const C& col_t;
69 const C& operator[](
unsigned i)
const;
70 const C& last_coord()
const;
72 const E& exact_()
const;
78 template <
typename C,
typename E>
79 struct subject_impl< point<grid::square, C>, E > :
80 subject_impl< const point<grid::square, C>, E >
83 typedef subject_impl< const point<grid::square, C>, E > super_;
90 using super_::operator[];
91 C& operator[](
unsigned i);
96 # ifndef MLN_INCLUDE_ONLY
100 template <
typename C,
typename E>
103 subject_impl< const point<grid::square, C>, E >::row()
const
105 return exact_().get_subject().row();
108 template <
typename C,
typename E>
111 subject_impl< const point<grid::square, C>, E >::col()
const
113 return exact_().get_subject().col();
116 template <
typename C,
typename E>
119 subject_impl< const point<grid::square, C>, E >::operator[](
unsigned i)
const
121 mln_precondition(i < 2);
122 return exact_().get_subject()[i];
125 template <
typename C,
typename E>
128 subject_impl< const point<grid::square, C>, E >::last_coord()
const
133 template <
typename C,
typename E>
136 subject_impl< const point<grid::square, C>, E >::exact_()
const
138 return internal::force_exact<const E>(*this);
143 template <
typename C,
typename E>
146 subject_impl< point<grid::square, C>, E >::row()
148 return exact_().get_subject().row();
151 template <
typename C,
typename E>
154 subject_impl< point<grid::square, C>, E >::col()
156 return exact_().get_subject().col();
159 template <
typename C,
typename E>
162 subject_impl< point<grid::square, C>, E >::operator[](
unsigned i)
164 mln_precondition(i < 2);
165 return exact_().get_subject()[i];
168 template <
typename C,
typename E>
171 subject_impl< point<grid::square, C>, E >::exact_()
173 return internal::force_exact<E>(*this);
176 # endif // ! MLN_INCLUDE_ONLY
184 # include <mln/core/alias/dpoint2d.hh>
187 #endif // ! MLN_CORE_ALIAS_POINT2D_HH