mirror of
https://github.com/arcan1s/result.git
synced 2025-04-24 23:47:18 +00:00
add const modifiers
This commit is contained in:
parent
65b5c8cc1d
commit
e2ee009b6a
@ -134,13 +134,16 @@ public:
|
|||||||
* @throw std::bad_variant_access
|
* @throw std::bad_variant_access
|
||||||
* @return result value if holded
|
* @return result value if holded
|
||||||
*/
|
*/
|
||||||
T get() { return std::get<T>(*this); };
|
T get() const { return std::get<T>(*this); };
|
||||||
/**
|
/**
|
||||||
* @brief get result error
|
* @brief get result error
|
||||||
* @throw std::bad_variant_access
|
* @throw std::bad_variant_access
|
||||||
* @return result error if holded
|
* @return result error if holded
|
||||||
*/
|
*/
|
||||||
Error<ErrorEnum> error() { return std::get<Error<ErrorEnum>>(*this); };
|
Error<ErrorEnum> error() const
|
||||||
|
{
|
||||||
|
return std::get<Error<ErrorEnum>>(*this);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief get result content
|
* @brief get result content
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user