Mark coral::expected constructs as constexpr

This commit is contained in:
kayomn 2023-02-28 17:34:28 +00:00
parent c16d5c08cb
commit 3e413ea45d

View File

@ -452,7 +452,7 @@ export namespace coral {
/** /**
* Constructs from `value`, creating an [expected] with the expected type. * Constructs from `value`, creating an [expected] with the expected type.
*/ */
expected(expects const & value) { constexpr expected(expects const & value) {
(*reinterpret_cast<expects *>(this->buffer)) = value; (*reinterpret_cast<expects *>(this->buffer)) = value;
this->buffer[buffer_size] = 1; this->buffer[buffer_size] = 1;
} }
@ -460,7 +460,7 @@ export namespace coral {
/** /**
* Constructs from `error`, creating an [expected] with an error. * Constructs from `error`, creating an [expected] with an error.
*/ */
expected(errors const & error) { constexpr expected(errors const & error) {
(*reinterpret_cast<errors *>(this->buffer)) = error; (*reinterpret_cast<errors *>(this->buffer)) = error;
} }