Move Cord copy constructor, copy assignment, and move assignment out of line. Outlining these special member functions avoids duplicating inline tree reference counting and Cordz tracking across callers. PiperOrigin-RevId: 1009904989
diff --git a/absl/strings/cord.cc b/absl/strings/cord.cc index f9f576a..5d6727f 100644 --- a/absl/strings/cord.cc +++ b/absl/strings/cord.cc
@@ -302,6 +302,12 @@ // -------------------------------------------------------------------- // Constructors and destructors +Cord::Cord(const Cord&) = default; + +Cord& Cord::operator=(const Cord&) = default; + +Cord& Cord::operator=(Cord&&) = default; + Cord::Cord(absl::string_view src, MethodIdentifier method) { const size_t n = src.size(); if (n <= InlineRep::kMaxInline) {
diff --git a/absl/strings/cord.h b/absl/strings/cord.h index 8fe8e9f..fb3b86e 100644 --- a/absl/strings/cord.h +++ b/absl/strings/cord.h
@@ -192,10 +192,10 @@ // movable. The moved-from state is valid but unspecified. // Moves need to be declared since they are otherwise inhibited via the // declaration of the destructor. - Cord(const Cord&) = default; + Cord(const Cord&); Cord(Cord&&) = default; - Cord& operator=(const Cord&) = default; - Cord& operator=(Cord&&) = default; + Cord& operator=(const Cord&); + Cord& operator=(Cord&&); // Creates a Cord from a `src` string. This constructor is marked explicit to // prevent implicit Cord constructions from arguments convertible to an