From d911ed1130bd79b6e1a8bdbf68aae6d6c334c14d Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Fri, 27 Jun 2025 12:48:46 +0100 Subject: add more [[nodiscard]] --- nihil.config/option.ccm | 8 ++++---- nihil.config/write.ccm | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'nihil.config') diff --git a/nihil.config/option.ccm b/nihil.config/option.ccm index c095d34..c6ebcae 100644 --- a/nihil.config/option.ccm +++ b/nihil.config/option.ccm @@ -78,17 +78,17 @@ protected: /* * Get or set this option as a string. */ - virtual auto get_string() const + [[nodiscard]] virtual auto get_string() const -> std::string = 0; - virtual auto set_string(std::string_view) + [[nodiscard]] virtual auto set_string(std::string_view) -> std::expected = 0; /* * Get or set this option as a UCL object. */ - virtual auto get_ucl() const + [[nodiscard]] virtual auto get_ucl() const -> std::expected = 0; - virtual auto set_ucl(ucl::object const &) + [[nodiscard]] virtual auto set_ucl(ucl::object const &) -> std::expected = 0; private: diff --git a/nihil.config/write.ccm b/nihil.config/write.ccm index cb35d76..8fb8151 100644 --- a/nihil.config/write.ccm +++ b/nihil.config/write.ccm @@ -11,12 +11,12 @@ export module nihil.config:write; import nihil; -export namespace nihil::config { +namespace nihil::config { /* * Write all config values (except defaults) to disk. */ -auto write_to(std::filesystem::path const &filename) -> +export [[nodiscard]] auto write_to(std::filesystem::path const &filename) -> std::expected; }; -- cgit v1.2.3