diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-12 10:50:16 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-12 13:47:31 -0400 |
commit | e2f94a8e2cf1761f5e2b0ae166f6a8bd73e0a15d (patch) | |
tree | 02c3bfc9f5bdc351dd92b9817d2acae9be375a93 /include/o3tl | |
parent | fdo#75264 fix incorrect/missing function tips in Calc (diff) | |
download | core-e2f94a8e2cf1761f5e2b0ae166f6a8bd73e0a15d.tar.gz core-e2f94a8e2cf1761f5e2b0ae166f6a8bd73e0a15d.zip |
Move this function object to o3tl.
Change-Id: I9d1710fbed3c5753e84ed343c5136ab87909624d
Diffstat (limited to 'include/o3tl')
-rw-r--r-- | include/o3tl/deleter.hxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx new file mode 100644 index 000000000000..7f9e50dd9146 --- /dev/null +++ b/include/o3tl/deleter.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_O3TL_DELETER_HXX +#define INCLUDED_O3TL_DELETER_HXX + +#include <functional> + +namespace o3tl { + +/** + * Function object to allow deleting instances stored in STL containers as + * pointers. + */ +template<typename T> +struct default_deleter : public std::unary_function<T*, void> +{ + void operator() (T* p) + { + delete p; + } +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |