From 35d93e16dca1a3f3dc0eb9d3b529a71b6bbdf585 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sun, 6 Sep 2020 05:03:37 +0300 Subject: [PATCH] Update VecMap.hpp --- module/Base/VecMap.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/Base/VecMap.hpp b/module/Base/VecMap.hpp index 4208c47e..7b672697 100644 --- a/module/Base/VecMap.hpp +++ b/module/Base/VecMap.hpp @@ -160,16 +160,16 @@ template < class Key, class T, class Pred = std::equal_to< Key > > struct VecMap [&](const_reference e) -> bool { return e.first == key; }); } /* -------------------------------------------------------------------------------------------- - * + * Check if an element with a specific key exists in the container. */ - // Check if an element with a specific key exists in the container. bool exists(const key_type & key) const noexcept { return find(key) != m_Storage.cend(); } /* -------------------------------------------------------------------------------------------- * Append a new element to the end of the container. */ template< class... Args > mapped_type & emplace_back( Args&&... args ) { - return m_Storage.emplace_back(std::forward< Args >(args)...).second; + m_Storage.emplace_back(std::forward< Args >(args)...); + return m_Storage.back().second; } /* -------------------------------------------------------------------------------------------- * Remove the last element of the container.