summaryrefslogtreecommitdiff
path: root/include/o3tl/make_shared.hxx
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:03:16 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-21 13:19:17 +0100
commit01baeab99890e5650b3dabc15f8d900490a5a133 (patch)
tree64a1b30b20a53262605312fff4d035876fc7c811 /include/o3tl/make_shared.hxx
parent0108cd51faf942b3fc3a292522d4b2f421f1cf45 (diff)
tdf#123936 Formatting files in module include with clang-format
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
Diffstat (limited to 'include/o3tl/make_shared.hxx')
-rw-r--r--include/o3tl/make_shared.hxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/o3tl/make_shared.hxx b/include/o3tl/make_shared.hxx
index 9d7998fd5a36..5d4d98e42b3a 100644
--- a/include/o3tl/make_shared.hxx
+++ b/include/o3tl/make_shared.hxx
@@ -14,14 +14,13 @@
#include <memory>
#include <type_traits>
-namespace o3tl {
-
+namespace o3tl
+{
/** Allocate an array stored in a shared_ptr, calling operator delete[].
Note that this is only allowed for arithmetic types because shared_ptr
implicitly converts to sub-types.
*/
-template<typename T>
-std::shared_ptr<T> make_shared_array(size_t const size)
+template <typename T> std::shared_ptr<T> make_shared_array(size_t const size)
{
static_assert(std::is_arithmetic<T>::value, "only arrays of arithmetic types allowed");
return std::shared_ptr<T>(new T[size], std::default_delete<T[]>());
@@ -31,8 +30,7 @@ std::shared_ptr<T> make_shared_array(size_t const size)
which won't throw in practice, or where std::terminate is
an acceptable response if they do
*/
-template<class T, class... Args>
-std::shared_ptr<T> make_shared(Args&&... args)
+template <class T, class... Args> std::shared_ptr<T> make_shared(Args&&... args)
{
#if defined(__COVERITY__)
return std::shared_ptr<T>(new T(std::forward<Args>(args)...), o3tl::default_delete<T>());