From 138d3f4d3d6e2aaf5ba34f89af15ef85ea074357 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 8 Nov 2021 09:23:38 +0800 Subject: *misc --- Runtime/Lua/LuaBind/signal/remove_from_container.h | 32 ---------------------- 1 file changed, 32 deletions(-) delete mode 100644 Runtime/Lua/LuaBind/signal/remove_from_container.h (limited to 'Runtime/Lua/LuaBind/signal/remove_from_container.h') diff --git a/Runtime/Lua/LuaBind/signal/remove_from_container.h b/Runtime/Lua/LuaBind/signal/remove_from_container.h deleted file mode 100644 index 9fdc442..0000000 --- a/Runtime/Lua/LuaBind/signal/remove_from_container.h +++ /dev/null @@ -1,32 +0,0 @@ -// Aseprite Base Library -// Copyright (c) 2001-2013 David Capello -// -// This file is released under the terms of the MIT license. -// Read LICENSE.txt for more information. - -#ifndef BASE_REMOVE_FROM_CONTAINER_H_INCLUDED -#define BASE_REMOVE_FROM_CONTAINER_H_INCLUDED -#pragma once - -namespace base { - -// Removes all ocurrences of the specified element from the STL container. -template -void remove_from_container(ContainerType& container, - typename ContainerType::const_reference element) -{ - for (typename ContainerType::iterator - it = container.begin(), - end = container.end(); it != end; ) { - if (*it == element) { - it = container.erase(it); - end = container.end(); - } - else - ++it; - } -} - -} - -#endif -- cgit v1.1-26-g67d0