Result cannot be discarded from now
This commit is contained in:
parent
35a8345bc5
commit
4a5c53240c
2
Makefile
2
Makefile
@ -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 \
|
||||
|
@ -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>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user