From 18ee33f79b21e6e5e1400737bf8084d5fae28545 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Fri, 10 Jul 2015 14:59:10 +0200 Subject: [PATCH] [GL] Abort in case of first <= last in ctor. This restores behaviour prior to removing throw. --- GeoLib/AABB.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GeoLib/AABB.h b/GeoLib/AABB.h index 666e47886cf..ca798d9eb1a 100644 --- a/GeoLib/AABB.h +++ b/GeoLib/AABB.h @@ -17,6 +17,7 @@ #include <limits> #include <cstddef> +#include <cstdlib> #include <iterator> #include <cassert> #include <vector> @@ -72,9 +73,11 @@ public: template <typename InputIterator> 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"); - assert(std::distance(first,last) > 0); + std::abort(); + } init(*first); InputIterator it(first); while (it != last) { -- GitLab