@@ -46,8 +46,7 @@ class TypeValue final : private common_internal::ValueMixin<TypeValue> {
4646 public:
4747 static constexpr ValueKind kKind = ValueKind::kType ;
4848
49- // NOLINTNEXTLINE(google-explicit-constructor)
50- TypeValue (Type value) noexcept : value_(std::move(value)) {}
49+ explicit TypeValue (Type value) : value_(std::move(value)) {}
5150
5251 TypeValue () = default ;
5352 TypeValue (const TypeValue&) = default ;
@@ -82,16 +81,24 @@ class TypeValue final : private common_internal::ValueMixin<TypeValue> {
8281
8382 bool IsZeroValue () const { return false ; }
8483
84+ ABSL_DEPRECATED ((" Use type()" ))
8585 const Type& NativeValue () const ABSL_ATTRIBUTE_LIFETIME_BOUND {
8686 return value_;
8787 }
8888
89+ const Type& type () const ABSL_ATTRIBUTE_LIFETIME_BOUND { return value_; }
90+
8991 void swap (TypeValue& other) noexcept {
9092 using std::swap;
9193 swap (value_, other.value_ );
9294 }
9395
94- absl::string_view name () const { return NativeValue ().name (); }
96+ absl::string_view name () const { return type ().name (); }
97+
98+ friend void swap (TypeValue& lhs, TypeValue& rhs) noexcept {
99+ using std::swap;
100+ swap (lhs.value_ , rhs.value_ );
101+ }
95102
96103 private:
97104 friend struct NativeTypeTraits <TypeValue>;
@@ -100,8 +107,6 @@ class TypeValue final : private common_internal::ValueMixin<TypeValue> {
100107 Type value_;
101108};
102109
103- inline void swap (TypeValue& lhs, TypeValue& rhs) noexcept { lhs.swap (rhs); }
104-
105110inline std::ostream& operator <<(std::ostream& out, const TypeValue& value) {
106111 return out << value.DebugString ();
107112}
0 commit comments