llvm.org GIT mirror llvm / d4c5f2a
[ADT] Remove a workaround for old versions of clang git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371856 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 9 months ago
1 changed file(s) with 1 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
3737 // implementation without requiring two members.
3838 template
3939 struct DenseMapPair : public std::pair {
40
41 // FIXME: Switch to inheriting constructors when we drop support for older
42 // clang versions.
43 // NOTE: This default constructor is declared with '{}' rather than
44 // '= default' to work around a separate bug in clang-3.8. This can
45 // also go when we switch to inheriting constructors.
46 DenseMapPair() {}
47
48 DenseMapPair(const KeyT &Key, const ValueT &Value)
49 : std::pair(Key, Value) {}
50
51 DenseMapPair(KeyT &&Key, ValueT &&Value)
52 : std::pair(std::move(Key), std::move(Value)) {}
53
54 template
55 DenseMapPair(AltKeyT &&AltKey, AltValueT &&AltValue,
56 typename std::enable_if<
57 std::is_convertible::value &&
58 std::is_convertible::value>::type * = 0)
59 : std::pair(std::forward(AltKey),
60 std::forward(AltValue)) {}
61
62 template
63 DenseMapPair(AltPairT &&AltPair,
64 typename std::enable_if
65 AltPairT, std::pair>::value>::type * = nullptr)
66 : std::pair(std::forward(AltPair)) {}
40 using std::pair::pair;
6741
6842 KeyT &getFirst() { return std::pair::first; }
6943 const KeyT &getFirst() const { return std::pair::first; }