From f2c5f9da25e57e2b00539cd176ec591906877c80 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 12 Jul 2023 18:23:51 +0200 Subject: [PATCH] Lua: allow to reserve STL vector size --- libs/lua/LuaBridge/detail/Namespace.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/lua/LuaBridge/detail/Namespace.h b/libs/lua/LuaBridge/detail/Namespace.h index 4fabf6d7a5..ce14090f39 100644 --- a/libs/lua/LuaBridge/detail/Namespace.h +++ b/libs/lua/LuaBridge/detail/Namespace.h @@ -2092,10 +2092,12 @@ public: Class > beginStdVector (char const* name) { typedef std::vector LT; + typedef typename std::vector::size_type T_SIZE; return beginConstStdVector (name) .addVoidConstructor () .addFunction ("push_back", (void (LT::*)(const T&))<::push_back) .addFunction ("clear", (void (LT::*)())<::clear) + .addFunction ("reserve", (void (LT::*)(T_SIZE))<::reserve) .addExtCFunction ("to_array", &CFunc::vectorToArray) .addExtCFunction ("add", &CFunc::tableToList); }