Commit f6ff9255 by Ralf W. Grosse-Kunstleve Committed by Copybara-Service

Systematically change `_` to `const_name` in pybind11_abseil, pybind11_protobuf.

This is a functional no-op.

Note that `_` was deprecated already in Dec 2021 (https://github.com/pybind/pybind11/pull/3423).

PiperOrigin-RevId: 575085924
parent 6c181d3d
......@@ -459,7 +459,8 @@ struct type_caster<absl::Span<T>> {
return *this;
}
static constexpr auto name = _("Span[") + make_caster<T>::name + _("]");
static constexpr auto name =
const_name("Span[") + make_caster<T>::name + const_name("]");
// We do not allow moving because 1) spans are super lightweight, so there's
// no advantage to moving and 2) the span cannot exist without the caster,
......
......@@ -52,7 +52,7 @@ struct type_caster<google::NoThrowStatus<StatusType>> {
template <>
struct type_caster<absl::Status> : public type_caster_base<absl::Status> {
public:
static constexpr auto name = _("None");
static constexpr auto name = const_name("None");
// Convert C++ -> Python.
static handle cast(const absl::Status* src, return_value_policy policy,
handle parent, bool throw_exception = true) {
......
......@@ -20,8 +20,9 @@ namespace detail {
template <typename PayloadType>
struct NoThrowStatusType<absl::StatusOr<PayloadType>> {
using NoThrowAbslStatus = type_caster_base<absl::Status>;
static constexpr auto name = _("Union[") + NoThrowAbslStatus::name + _(", ") +
make_caster<PayloadType>::name + _("]");
static constexpr auto name = const_name("Union[") + NoThrowAbslStatus::name +
const_name(", ") +
make_caster<PayloadType>::name + const_name("]");
};
// Convert absl::StatusOr<T>.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment