debug/assert: add warn_return
This commit is contained in:
parent
aa1d35cdf6
commit
ca192ef4d8
@ -13,6 +13,8 @@
|
||||
//#include "maths.hpp" // XXX: See notes at the end of file for maths.hpp inclusion
|
||||
#include "debugger.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// it is fractionally easier to define a constexpr variable which can be used
|
||||
@ -389,6 +391,17 @@ void warn (std::string_view);
|
||||
void warn (const char *);
|
||||
|
||||
|
||||
template <typename ValueT>
|
||||
decltype(auto)
|
||||
warn_return (
|
||||
char const *message,
|
||||
ValueT &&value
|
||||
) {
|
||||
warn (message);
|
||||
return std::forward<ValueT> (value);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// XXX: maths needs to be included so that CHECK_EQ/NEQ can call almost_equal,
|
||||
// but maths.hpp might be using CHECK_ macros so we must include maths.hpp
|
||||
|
Loading…
Reference in New Issue
Block a user