From 20b8538a197c45597eecf5c7a51058263e816eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Wed, 12 Jun 2024 22:46:16 +0000 Subject: libcamera: yaml_parser: Make default value templated in `get()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way the construction of the default value of type `T` can be delayed until it is really needed, which is useful, for example when `T == std::string` and the default value comes from a string literal, as the default value string would always be constructed otherwise, even if not needed. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- src/libcamera/yaml_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcamera') diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp index aac9a2bd..b68a44c1 100644 --- a/src/libcamera/yaml_parser.cpp +++ b/src/libcamera/yaml_parser.cpp @@ -104,7 +104,7 @@ std::size_t YamlObject::size() const */ /** - * \fn template YamlObject::get(const T &defaultValue) const + * \fn template YamlObject::get(U &&defaultValue) const * \brief Parse the YamlObject as a \a T value * \param[in] defaultValue The default value when failing to parse * -- cgit v1.2.1