From 555aa034fd870436ff0168642ea22428962ec73c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 19 Dec 2025 15:11:35 +0100 Subject: feat: parser.hpp: Use [[nodiscard]] in `operator[]`. Signed-off-by: Amlal El Mahrouss --- include/ocl/fix/checksum.hpp | 2 +- include/ocl/fix/parser.hpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/ocl/fix/checksum.hpp b/include/ocl/fix/checksum.hpp index f124a08..592d33d 100644 --- a/include/ocl/fix/checksum.hpp +++ b/include/ocl/fix/checksum.hpp @@ -14,4 +14,4 @@ namespace ocl::fix { } -#endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/include/ocl/fix/parser.hpp b/include/ocl/fix/parser.hpp index 3074cf7..41d3638 100644 --- a/include/ocl/fix/parser.hpp +++ b/include/ocl/fix/parser.hpp @@ -19,7 +19,7 @@ namespace ocl::fix /// @brief Buffer+Length structure using range_ptr_type = range*; - using range_type = range; + using range_type = range; using tag_type = std::string; using value_type = std::string; @@ -74,6 +74,7 @@ namespace ocl::fix range_buffer& operator=(const range_buffer&) = default; range_buffer(const range_buffer&) = default; + [[nodiscard("please use the returned value of the tag.")]] value_type operator[](const tag_type& key) { if (key.empty()) @@ -161,4 +162,4 @@ namespace ocl::fix }; } // namespace ocl::fix -#endif // ifndef __OCL_FIX_PARSER \ No newline at end of file +#endif // ifndef __OCL_FIX_PARSER -- cgit v1.2.3