mirror of
https://github.com/arcan1s/result.git
synced 2026-11-21 10:29:29 +00:00
add const modifiers
This commit is contained in:
1 parent
65b5c8cc1d
commit
e2ee009b6a
1 file changed
+5
-2
+5
-2
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in new issue
Block a user