From add3894e8c0ddc7533b6bedd97033a36e60695d8 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 13 Aug 2020 09:00:58 +0200 Subject: [PATCH] Add reserve_vector to libslic3r.h to be globally usable. --- src/libslic3r/MTUtils.hpp | 9 --------- src/libslic3r/libslic3r.h | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/MTUtils.hpp b/src/libslic3r/MTUtils.hpp index a6c8d6162..555cfe501 100644 --- a/src/libslic3r/MTUtils.hpp +++ b/src/libslic3r/MTUtils.hpp @@ -114,15 +114,6 @@ template struct remove_cvref template using remove_cvref_t = typename remove_cvref::type; -template // Arbitrary allocator can be used -inline IntegerOnly> reserve_vector(I capacity) -{ - std::vector ret; - if (capacity > I(0)) ret.reserve(size_t(capacity)); - - return ret; -} - /// Exactly like Matlab https://www.mathworks.com/help/matlab/ref/linspace.html template> inline std::vector linspace_vector(const ArithmeticOnly &start, diff --git a/src/libslic3r/libslic3r.h b/src/libslic3r/libslic3r.h index 5e57c4591..76ff27136 100644 --- a/src/libslic3r/libslic3r.h +++ b/src/libslic3r/libslic3r.h @@ -266,6 +266,15 @@ using IteratorOnly = std::enable_if_t< !std::is_same_v::value_type, void>, O >; +template // Arbitrary allocator can be used +IntegerOnly> reserve_vector(I capacity) +{ + std::vector ret; + if (capacity > I(0)) ret.reserve(size_t(capacity)); + + return ret; +} + } // namespace Slic3r #endif