- nonstd::optional<ConstField> operator[](const char * const name) const noexcept
- {
- const auto libObjPtr =
- internal::CommonStructureFieldSpec<const bt_field>::memberFieldByName(this->libObjPtr(),
- name);
-
- if (libObjPtr) {
- return ConstField {libObjPtr};
- }
-
- return nonstd::nullopt;
- }
-
- nonstd::optional<ConstField> operator[](const std::string& name) const noexcept
- {
- return (*this)[name.data()];
- }
-
- nonstd::optional<CommonField<LibObjT>> operator[](const char * const name) noexcept
- {
- const auto libObjPtr = _Spec::memberFieldByName(this->libObjPtr(), name);
-
- if (libObjPtr) {
- return CommonField<LibObjT> {libObjPtr};
- }
-
- return nonstd::nullopt;
- }
-
- nonstd::optional<CommonField<LibObjT>> operator[](const std::string& name) noexcept
+ OptionalBorrowedObject<CommonField<LibObjT>>
+ operator[](const bt2c::CStringView name) const noexcept