From 6c9695d16c157e9119dcf897266e8643e6565213 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Thu, 17 Aug 2023 23:36:53 +0200 Subject: enable misc-*,bugprone-* lints --- option.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'option.h') diff --git a/option.h b/option.h index ab7a72e..47a0624 100644 --- a/option.h +++ b/option.h @@ -33,20 +33,20 @@ struct option { constexpr option(const option& op) : m_has_value{op.has_value()} { if (op.has_value()) { // Copy construct from inner VALUE of OP. - new (m_value) T(op.value()); + new (&m_value) T(op.value()); } } constexpr option(option&& op) noexcept : m_has_value{op.has_value()} { if (op.m_has_value) { // Move construct from inner VALUE of OP. - new (m_value) T(std::move(op.take())); + new (&m_value) T(std::move(op.take())); } } template constexpr option(T&& val) : m_has_value{true} { - new (m_value) T(std::move(val)); + new (&m_value) T(std::move(val)); } // -- DESTRUCTOR ------------------------------------------------------------- @@ -60,7 +60,7 @@ struct option { template constexpr T& emplace(Params&&... params) { reset(); - new (m_value) T(std::forward(params)...); + new (&m_value) T(std::forward(params)...); m_has_value = true; return value(); } -- cgit v1.2.3