diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index a22696032..8c7a0fa97 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -191,17 +191,19 @@ public: template Range get_slice_records(Key from, Key to = std::numeric_limits::max()) const { + static_assert (std::is_integral::value || + std::is_floating_point::value, + "Only floating point or integral types are allowed."); + SliceIndex::const_iterator it_from, it_to; + if(std::is_integral::value) { it_from = search_slice_index(SliceRecord::Key(from)); it_to = search_slice_index(SliceRecord::Key(to)); } else if(std::is_floating_point::value) { it_from = search_slice_index(float(from)); it_to = search_slice_index(float(to)); - } else return { - SliceRecordConstIterator(m_slice_index, _SliceRecord::NONE ), - SliceRecordConstIterator(m_slice_index, _SliceRecord::NONE ), - }; + } auto start = m_slice_index.begin();