Mark coral::expected constructs as constexpr
This commit is contained in:
parent
c16d5c08cb
commit
3e413ea45d
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user