This repository was archived by the owner on Feb 5, 2019. It is now read-only.
File tree 2 files changed +2
-14
lines changed 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -429,7 +429,7 @@ template <class T> class LLVM_NODISCARD Expected {
429
429
430
430
static const bool isRef = std::is_reference<T>::value;
431
431
432
- using wrap = ReferenceStorage <typename std::remove_reference<T>::type>;
432
+ using wrap = std::reference_wrapper <typename std::remove_reference<T>::type>;
433
433
434
434
using error_type = std::unique_ptr<ErrorInfoBase>;
435
435
Original file line number Diff line number Diff line change 24
24
25
25
namespace llvm {
26
26
27
- // / Stores a reference that can be changed.
28
- template <typename T>
29
- class ReferenceStorage {
30
- T *Storage;
31
-
32
- public:
33
- ReferenceStorage (T &Ref) : Storage(&Ref) {}
34
-
35
- operator T &() const { return *Storage; }
36
- T &get () const { return *Storage; }
37
- };
38
-
39
27
// / Represents either an error or a value T.
40
28
// /
41
29
// / ErrorOr<T> is a pointer-like class that represents the result of an
@@ -71,7 +59,7 @@ class ErrorOr {
71
59
72
60
static const bool isRef = std::is_reference<T>::value;
73
61
74
- using wrap = ReferenceStorage <typename std::remove_reference<T>::type>;
62
+ using wrap = std::reference_wrapper <typename std::remove_reference<T>::type>;
75
63
76
64
public:
77
65
using storage_type = typename std::conditional<isRef, wrap, T>::type;
You can’t perform that action at this time.
0 commit comments