瀏覽代碼

added Result copy constructor

develop
Robin Thoni 8 年之前
父節點
當前提交
43202888e9
共有 1 個檔案被更改,包括 9 行新增0 行删除
  1. 9
    0
      libnfc_cpptools/inc/libnfc_cpptools/Result.h

+ 9
- 0
libnfc_cpptools/inc/libnfc_cpptools/Result.h 查看文件

20
 {
20
 {
21
 public:
21
 public:
22
     Result();
22
     Result();
23
+    Result(const Result<T>& other);
23
 
24
 
24
     static const Result<T> ok(const T& data);
25
     static const Result<T> ok(const T& data);
25
     static const Result<T> strerror();
26
     static const Result<T> strerror();
67
 {
68
 {
68
 }
69
 }
69
 
70
 
71
+template<class T>
72
+Result<T>::Result(const Result<T>& other)
73
+        : _data(other._data)
74
+        , _success(other._success)
75
+        , _error(other._error)
76
+{
77
+}
78
+
70
 template<class T>
79
 template<class T>
71
 const Result<T> Result<T>::ok(const T& data)
80
 const Result<T> Result<T>::ok(const T& data)
72
 {
81
 {

Loading…
取消
儲存