Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pybind11_protobuf/proto_cast_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ absl::optional<py::object> ResolveAttrs(
PyObject* attr = PyObject_GetAttrString(obj.ptr(), name);
if (attr == nullptr) {
PyErr_Clear();
return absl::nullopt;
return std::nullopt;
}
tmp = py::reinterpret_steal<py::object>(attr);
obj = py::handle(attr);
Expand All @@ -110,7 +110,7 @@ absl::optional<py::object> ResolveAttrMRO(py::handle obj, const char* name) {
return py::reinterpret_steal<py::object>(attr);
}
PyErr_Clear();
return absl::nullopt;
return std::nullopt;
}

auto unicode = py::reinterpret_steal<py::object>(PyUnicode_FromString(name));
Expand All @@ -132,7 +132,7 @@ absl::optional<py::object> ResolveAttrMRO(py::handle obj, const char* name) {
PyErr_Clear();
}
}
return absl::nullopt;
return std::nullopt;
}

absl::optional<std::string> CastToOptionalString(py::handle src) {
Expand All @@ -141,7 +141,7 @@ absl::optional<std::string> CastToOptionalString(py::handle src) {
if (c.load(src, false)) {
return pybind11::detail::cast_op<std::string>(std::move(c));
}
return absl::nullopt;
return std::nullopt;
}

class GlobalState {
Expand Down Expand Up @@ -321,10 +321,10 @@ class PythonDescriptorPoolWrapper {
// may outlive the python pool, and (2) for the fast_cpp_proto case, there's
// no support for weak references.

auto database = absl::make_unique<DescriptorPoolDatabase>(
auto database = std::make_unique<DescriptorPoolDatabase>(
py::reinterpret_borrow<py::object>(python_pool));
auto pool = absl::make_unique<DescriptorPool>(database.get());
auto factory = absl::make_unique<DynamicMessageFactory>(pool.get());
auto pool = std::make_unique<DescriptorPool>(database.get());
auto factory = std::make_unique<DynamicMessageFactory>(pool.get());
// When wrapping the Python descriptor_poool.Default(), apply an important
// optimization:
// - the pool is based on the C++ generated_pool(), so that compiled
Expand Down Expand Up @@ -498,7 +498,7 @@ absl::optional<std::string> PyProtoDescriptorFullName(py::handle py_proto) {
if (py_full_name) {
return CastToOptionalString(*py_full_name);
}
return absl::nullopt;
return std::nullopt;
}

bool PyProtoHasMatchingFullName(py::handle py_proto,
Expand Down
Loading