diff --git a/libs/geom/include/psemek/geom/gradient.hpp b/libs/geom/include/psemek/geom/gradient.hpp index e7b33b8a..028b9470 100644 --- a/libs/geom/include/psemek/geom/gradient.hpp +++ b/libs/geom/include/psemek/geom/gradient.hpp @@ -14,6 +14,8 @@ namespace psemek::geom { using result_type = R; + gradient() = default; + template gradient(Args const & ... args) { @@ -29,6 +31,8 @@ namespace psemek::geom R operator()(T const & t) const { + assert(!points_.empty()); + auto it = std::upper_bound(points_.begin(), points_.end(), t, [](T const & t, auto const & p){ return t < p.first; }); if (it == points_.begin()) return points_.front().second;