로딩중...
검색중...
일치하는것 없음
tres.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
4#include "tmay.hpp"
5
6namespace by {
7
35 template <typename T, typename R> class tres: public tmay<T> {
36 typedef tres<T, R> __me__;
37 BY(ME(__me__, tmay<T>))
38
39 public:
40 tres() = default;
41 explicit tres(const T& value);
42 explicit tres(const R& value);
43
44 public:
52 const R& getErr() const BY_CONST_FUNC(getErr())
57 void rel() override;
65 void setErr(const R& arg);
66
67 private:
68 std::optional<R> _err;
69 };
70} // namespace by
Optional value wrapper for error indication without exceptions
Definition tmay.hpp:50
Template result container with typed error information
Definition tres.hpp:35
const R & getErr() const BY_CONST_FUNC(getErr()) void rel() override
Releases/clears both the contained value and the error, making the instance empty.
void setErr(const R &arg)
Sets the contained error and clears any existing value.
R & getErr()
Gets the contained error.
void set(const T &arg) override
Sets the contained value and clears any existing error.
Weak reference smart pointer with type-safe access
Definition tweak.hpp:16
to Top