diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 437f07fcb..a5fcaf3f3 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -755,9 +755,12 @@ public: return m_compact_bridges; } - template inline - typename std::enable_if::value, const Pillar&>::type - pillar(T id) const { assert(id >= 0); return m_pillars.at(size_t(id)); } + template inline const Pillar& pillar(T id) const { + static_assert(std::is_integral::value, "Invalid index type"); + assert(id >= 0 && id < m_pillars.size() && + id < std::numerix_limits::max()); + return m_pillars[size_t(id)]; + } const Pad& create_pad(const TriangleMesh& object_supports, const ExPolygons& baseplate,