fix result unused attribute

This commit is contained in:
Lion Kortlepel 2024-03-27 16:31:11 +01:00
parent d11262f38d
commit 2d5f95cf4d
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -3,9 +3,15 @@
#include <boost/outcome.hpp>
#include <boost/outcome/success_failure.hpp>
#ifdef WIN32
#define BEAMMP_WARN_UNUSED
#else
#define BEAMMP_WARN_UNUSED __attribute__((warn_unused_result))
#endif
// attribute because [[nodiscard]] isn't possible on using decls - if you wanna write a standards proposal,
// this is one to write.
template<typename T, typename EC>
using Result __attribute__((warn_unused_result)) = boost::outcome_v2::result<T, EC>;
using Result BEAMMP_WARN_UNUSED = boost::outcome_v2::result<T, EC>;
namespace outcome = boost::outcome_v2;