summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-07-17 14:40:14 -0700
committerWilliam A. Kennington III <wak@google.com>2018-07-17 14:40:14 -0700
commitca7db85129955a8398535fb71d5d209201daafda (patch)
tree55198627cc56475b629d6d9f37ffb2490147e0cc
parent6364dd9eca6310fc55073ce6efa822f09b530c9f (diff)
downloadsdeventplus-ca7db85129955a8398535fb71d5d209201daafda.tar.gz
sdeventplus-ca7db85129955a8398535fb71d5d209201daafda.zip
clang-format: Always break template declarations
-rw-r--r--.clang-format2
-rw-r--r--src/sdeventplus/internal/sdref.cpp12
-rw-r--r--src/sdeventplus/internal/sdref.hpp3
3 files changed, 11 insertions, 6 deletions
diff --git a/.clang-format b/.clang-format
index 8872c3b..9109e65 100644
--- a/.clang-format
+++ b/.clang-format
@@ -17,7 +17,7 @@ AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: false
+AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
diff --git a/src/sdeventplus/internal/sdref.cpp b/src/sdeventplus/internal/sdref.cpp
index 44e38d6..bbbbd3a 100644
--- a/src/sdeventplus/internal/sdref.cpp
+++ b/src/sdeventplus/internal/sdref.cpp
@@ -28,7 +28,8 @@ SdRef<T>::SdRef(const SdRef& other) :
{
}
-template <typename T> SdRef<T>& SdRef<T>::operator=(const SdRef& other)
+template <typename T>
+SdRef<T>& SdRef<T>::operator=(const SdRef& other)
{
if (this != &other)
{
@@ -44,7 +45,8 @@ template <typename T> SdRef<T>& SdRef<T>::operator=(const SdRef& other)
return *this;
}
-template <typename T> SdRef<T>& SdRef<T>::operator=(SdRef&& other)
+template <typename T>
+SdRef<T>& SdRef<T>::operator=(SdRef&& other)
{
if (this != &other)
{
@@ -60,14 +62,16 @@ template <typename T> SdRef<T>& SdRef<T>::operator=(SdRef&& other)
return *this;
}
-template <typename T> SdRef<T>::~SdRef()
+template <typename T>
+SdRef<T>::~SdRef()
{
// release_ref will be invalid after a move
if (release_ref)
release_ref(sdevent, ref);
}
-template <typename T> T* SdRef<T>::get() const
+template <typename T>
+T* SdRef<T>::get() const
{
return ref;
}
diff --git a/src/sdeventplus/internal/sdref.hpp b/src/sdeventplus/internal/sdref.hpp
index bd220dd..0b1395f 100644
--- a/src/sdeventplus/internal/sdref.hpp
+++ b/src/sdeventplus/internal/sdref.hpp
@@ -9,7 +9,8 @@ namespace sdeventplus
namespace internal
{
-template <typename T> class SdRef
+template <typename T>
+class SdRef
{
public:
using Func = std::function<T*(SdEvent*, T*)>;
OpenPOWER on IntegriCloud