From 3e413ea45d9768ca76ac1e8b604c1df478389856 Mon Sep 17 00:00:00 2001 From: kayomn Date: Tue, 28 Feb 2023 17:34:28 +0000 Subject: [PATCH] Mark coral::expected constructs as constexpr --- source/coral.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/coral.cpp b/source/coral.cpp index 139c8a1..e8bdc5d 100755 --- a/source/coral.cpp +++ b/source/coral.cpp @@ -452,7 +452,7 @@ export namespace coral { /** * Constructs from `value`, creating an [expected] with the expected type. */ - expected(expects const & value) { + constexpr expected(expects const & value) { (*reinterpret_cast(this->buffer)) = value; this->buffer[buffer_size] = 1; } @@ -460,7 +460,7 @@ export namespace coral { /** * Constructs from `error`, creating an [expected] with an error. */ - expected(errors const & error) { + constexpr expected(errors const & error) { (*reinterpret_cast(this->buffer)) = error; }