proto-1.0 47: Preconditions in oln::abstract::image_with_data

https://svn.lrde.epita.fr/svn/oln/prototypes/proto-1.0 ChangeLog | 6 ++++++ oln/core/abstract/image_with_data.hh | 5 +++++ 2 files changed, 11 insertions(+) Index: olena/ChangeLog from Roland Levillain <roland@lrde.epita.fr> * oln/core/abstract/image_with_data.hh (impl_size, impl_npoints) (impl_hold, impl_get, impl_set): Ensure that the image contains data. Index: olena/oln/core/abstract/image_with_data.hh --- olena/oln/core/abstract/image_with_data.hh (revision 46) +++ olena/oln/core/abstract/image_with_data.hh (working copy) @@ -70,6 +70,7 @@ const oln_size_type(E)& impl_size() const { + precondition(this->has_data()); return this->data_->size(); } @@ -83,6 +84,7 @@ unsigned long impl_npoints() const { + precondition(this->has_data()); return this->data_->npoints(); } @@ -97,6 +99,7 @@ bool impl_hold(const oln_point_type(E)& p) const { + precondition(this->has_data()); return this->data_->hold(p); } @@ -110,6 +113,7 @@ const oln_value_type(E) impl_get(const oln_point_type(E)& p) const { + precondition(this->has_data()); return this->data_->get(p); } @@ -121,6 +125,7 @@ template <typename V> void impl_set(const oln_point_type(E)& p, const V& v) { + precondition(this->has_data()); this->data_->set(p, v); }
participants (1)
-
Roland Levillain