@@ -124,7 +124,7 @@ public:
class DictIterator : public Iterator<DictIterator>
{
public:
- using value_type = std::pair<const std::string &, const YamlObject &>;
+ using value_type = std::pair<std::string_view, const YamlObject &>;
using pointer = value_type *;
using reference = value_type &;
@@ -312,7 +312,7 @@ template std::optional<std::vector<Size>> YamlObject::getList<Size>() const;
* iteration order is not specified.
*
* The iterator's value_type is a
- * <em>std::pair<const std::string &, const \ref YamlObject &></em>.
+ * <em>std::pair<std::string_view, const \ref YamlObject &></em>.
*
* If the YamlObject is not of Dictionary type, the returned adapter operates
* as an empty container.
This showcases how std::string_view can replace a const std::string reference as a key in a std::map. The patch does not compile due the lack of heterogenous lookup functions for containers (see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html), and must therefore not be integrated. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- include/libcamera/internal/yaml_parser.h | 2 +- src/libcamera/yaml_parser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)