Skip to content
Snippets Groups Projects
Commit 0c9906bd authored by Sam Yates's avatar Sam Yates Committed by Benjamin Cumming
Browse files

Remove NDEBUG tests in memory utils. (#523)

Fixes #182.
parent 3ee79191
No related branches found
No related tags found
No related merge requests found
......@@ -180,31 +180,23 @@ public:
/// access half open sub-range using two indexes [left, right)
view_type operator()(size_type left, size_type right) {
#ifndef NDEBUG
arb_assert(right<=size_ && left<=right);
#endif
return view_type(pointer_+left, right-left);
}
const_view_type operator()(size_type left, size_type right) const {
#ifndef NDEBUG
arb_assert(right<=size_ && left<=right);
#endif
return view_type(pointer_+left, right-left);
}
/// access half open sub-range using one index and one-past-the-end [left, end)
view_type operator()(size_type left, end_type) {
#ifndef NDEBUG
arb_assert(left<=size_);
#endif
return view_type(pointer_+left, size_-left);
}
const_view_type operator()(size_type left, end_type) const {
#ifndef NDEBUG
arb_assert(left<=size_);
#endif
return view_type(pointer_+left, size_-left);
}
......@@ -260,16 +252,12 @@ public:
// per element accessors
// return a reference type provided by Coordinator
reference operator[] (size_type i) {
#ifndef NDEBUG
arb_assert(i<size_);
#endif
return coordinator_.make_reference(pointer_+i);
}
const_reference operator[] (size_type i) const {
#ifndef NDEBUG
arb_assert(i<size_);
#endif
return coordinator_.make_reference(pointer_+i);
}
......@@ -385,17 +373,13 @@ public:
/// access half open sub-range using two indexes [left, right)
const_view_type operator()(size_type left, size_type right) const {
#ifndef NDEBUG
arb_assert(right<=size_ && left<=right);
#endif
return const_view_type(pointer_+left, right-left);
}
/// access half open sub-range using one index and one-past-the-end [left, end)
const_view_type operator()(size_type left, end_type) const {
#ifndef NDEBUG
arb_assert(left<=size_);
#endif
return const_view_type(pointer_+left, size_-left);
}
......@@ -439,9 +423,7 @@ public:
// per element accessors
// return a reference type provided by Coordinator
const_reference operator[] (size_type i) const {
#ifndef NDEBUG
arb_assert(i<size_);
#endif
return coordinator_.make_reference(pointer_+i);
}
......
......@@ -11,9 +11,7 @@ namespace memory {
template <typename LHS, typename RHS>
void copy(LHS&& from, RHS&& to) {
#ifndef NDEBUG
arb_assert(from.size() == to.size());
#endif
#ifdef VERBOSE
std::cerr
<< util::blue("copy") << " "
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment