Skip to content
Snippets Groups Projects
Commit 18ee33f7 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[GL] Abort in case of first <= last in ctor.

This restores behaviour prior to removing throw.
parent b72e2141
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <limits> #include <limits>
#include <cstddef> #include <cstddef>
#include <cstdlib>
#include <iterator> #include <iterator>
#include <cassert> #include <cassert>
#include <vector> #include <vector>
...@@ -72,9 +73,11 @@ public: ...@@ -72,9 +73,11 @@ public:
template <typename InputIterator> template <typename InputIterator>
AABB(InputIterator first, InputIterator last) AABB(InputIterator first, InputIterator last)
{ {
if (!(std::distance(first,last) > 0)) if (std::distance(first,last) <= 0)
{
ERR("AABB::AABB(InputIterator first, InputIterator last): first > last"); ERR("AABB::AABB(InputIterator first, InputIterator last): first > last");
assert(std::distance(first,last) > 0); std::abort();
}
init(*first); init(*first);
InputIterator it(first); InputIterator it(first);
while (it != last) { while (it != last) {
......
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