Mercurial > code
changeset 655:a0239cca29fa
json_util: use std::string_view and pet doxygen
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 21 Jan 2019 20:39:31 +0100 |
parents | 5f00a9691da5 |
children | 734ce3a26a58 |
files | cpp/json_util/json_util.hpp extern/libjson/CMakeLists.txt |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/cpp/json_util/json_util.hpp Mon Jan 21 20:39:31 2019 +0100 +++ b/cpp/json_util/json_util.hpp Mon Jan 21 20:39:31 2019 +0100 @@ -251,6 +251,7 @@ * - Object property is not the same type * * \param key the property key + * \param def the default value * \return the object or def * \throw any exception from nlohmann::json constructor */ @@ -278,7 +279,7 @@ * \return the value, std::nullopt or def */ template <typename Type, typename DefaultValue> - auto optional(const std::string& key, DefaultValue&& def) const noexcept -> std::optional<Type> + auto optional(std::string_view key, DefaultValue&& def) const noexcept -> std::optional<Type> { const auto it = find(key);
--- a/extern/libjson/CMakeLists.txt Mon Jan 21 20:39:31 2019 +0100 +++ b/extern/libjson/CMakeLists.txt Mon Jan 21 20:39:31 2019 +0100 @@ -1,7 +1,7 @@ # # CMakeLists.txt -- CMake build system for nlohmann's json # -# Copyright (c) 2016-2018 David Demelier <markand@malikania.fr> +# Copyright (c) 2016-2019 David Demelier <markand@malikania.fr> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above