Browse Source

added Result copy constructor

develop
Robin Thoni 7 years ago
parent
commit
43202888e9
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      libnfc_cpptools/inc/libnfc_cpptools/Result.h

+ 9
- 0
libnfc_cpptools/inc/libnfc_cpptools/Result.h View File

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…
Cancel
Save