diff --git a/include/gp/vector.hpp b/include/gp/vector.hpp index 05e9d27..4cb8663 100644 --- a/include/gp/vector.hpp +++ b/include/gp/vector.hpp @@ -178,6 +178,16 @@ namespace gp{ return false; } + template + constexpr bool emplace_back(U&&... value) { + if(grow()) { + new(ary+sz) T(gp::forward(value)...); + sz++; + return true; + } + return false; + } + constexpr gp::optional pop_back() { if(sz == 0) return gp::nullopt; sz--;