Status: Add comment about const ref parameters (#29973)

pull/29975/head^2
Yash Tibrewal 3 years ago committed by GitHub
parent a78df68e96
commit b9aec4def7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      include/grpcpp/impl/codegen/status.h

@ -92,6 +92,10 @@ class GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING Status {
/// Construct an instance with associated \a code and \a error_message.
/// It is an error to construct an OK status with non-empty \a error_message.
/// Note that \a message is intentionally accepted as a const reference
/// instead of a value (which results in a copy instead of a move) to allow
/// for easy transition to absl::Status in the future which accepts an
/// absl::string_view as a parameter.
Status(StatusCode code, const std::string& error_message)
: code_(code), error_message_(error_message) {}

Loading…
Cancel
Save