Result cannot be discarded from now

This commit is contained in:
Robert Bendun 2022-05-08 15:57:31 +02:00
parent 35a8345bc5
commit 4a5c53240c
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)"
CXXFLAGS:=$(CXXFLAGS) -std=c++20 -Wall -Wextra -Werror=switch
CXXFLAGS:=$(CXXFLAGS) -std=c++20 -Wall -Wextra -Werror=switch -Werror=unused-result
CPPFLAGS:=$(CPPFLAGS) -Ilib/expected/ -Ilib/ut/ -Isrc/
Obj=bin/errors.o \

View File

@ -96,7 +96,7 @@ struct Error
std::ostream& operator<<(std::ostream& os, Error const& err);
template<typename T>
struct Result : tl::expected<T, Error>
struct [[nodiscard("This value may contain critical error, so it should NOT be ignored")]] Result : tl::expected<T, Error>
{
using Storage = tl::expected<T, Error>;