summaryrefslogtreecommitdiff
path: root/AK/Optional.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-12-30 22:44:54 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-31 21:51:00 +0100
commitbbe787a0afd51307cdac2c023895c19df31519ca (patch)
tree44dc80cf50b22b461c27c1e9d99fa2c9ff00e22e /AK/Optional.h
parent2568a93b5dd29d2b06d613a4ece502ee696f189a (diff)
downloadserenity-bbe787a0afd51307cdac2c023895c19df31519ca.zip
Everywhere: Re-format with clang-format-11
Compared to version 10 this fixes a bunch of formatting issues, mostly around structs/classes with attributes like [[gnu::packed]], and incorrect insertion of spaces in parameter types ("T &"/"T &&"). I also removed a bunch of // clang-format off/on and FIXME comments that are no longer relevant - on the other hand it tried to destroy a couple of neatly formatted comments, so I had to add some as well.
Diffstat (limited to 'AK/Optional.h')
-rw-r--r--AK/Optional.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/AK/Optional.h b/AK/Optional.h
index f2fd929fb3..145081d62d 100644
--- a/AK/Optional.h
+++ b/AK/Optional.h
@@ -35,8 +35,7 @@
namespace AK {
template<typename T>
-class alignas(T) [[nodiscard]] Optional
-{
+class alignas(T) [[nodiscard]] Optional {
public:
Optional() { }
@@ -53,13 +52,13 @@ public:
new (&m_storage) T(value);
}
- Optional(T && value)
+ Optional(T&& value)
: m_has_value(true)
{
new (&m_storage) T(move(value));
}
- Optional(Optional && other)
+ Optional(Optional&& other)
: m_has_value(other.m_has_value)
{
if (other.has_value()) {
@@ -119,7 +118,7 @@ public:
}
template<typename... Parameters>
- ALWAYS_INLINE void emplace(Parameters && ... parameters)
+ ALWAYS_INLINE void emplace(Parameters&&... parameters)
{
clear();
m_has_value = true;