aboutsummaryrefslogtreecommitdiffhomepage
path: root/print.html
diff options
context:
space:
mode:
authorjohannst <johannst@users.noreply.github.com>2023-08-01 21:36:44 +0000
committerjohannst <johannst@users.noreply.github.com>2023-08-01 21:36:44 +0000
commit928b2fa4af916a5f75d1269620914f7bb4225e6e (patch)
treea4f55d013543b79d3acc84c39238ae9ce9cbff9f /print.html
parent75983cdedc08916cc08875cb8b543ecf6befb35f (diff)
downloadnotes-928b2fa4af916a5f75d1269620914f7bb4225e6e.tar.gz
notes-928b2fa4af916a5f75d1269620914f7bb4225e6e.zip
deploy: e6cab7826a010b34670e825650167b0d975d5819
Diffstat (limited to 'print.html')
-rw-r--r--print.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/print.html b/print.html
index 331b940..f09b78b 100644
--- a/print.html
+++ b/print.html
@@ -3324,7 +3324,11 @@ struct option {
constexpr T&amp; value() {
assert(m_has_val);
- return *reinterpret_cast&lt;T*&gt;(m_val);
+ // Placement new starts a new lifetime, launder pointer returned to the
+ // aligned storage.
+ //
+ // [1] https://en.cppreference.com/w/cpp/utility/launder
+ return *__builtin_launder(reinterpret_cast&lt;T*&gt;(m_val));
}
private: