cjdb-ranges
cjdb-ranges copied to clipboard
Replace CJDB_NOEXCEPT_RETURN with proposed CJDB_DEDUCE_NOEXCEPT
template<typename T>
constexpr auto operator()(T&& t) const
CJDB_DEDUCE_NOEXCEPT({
return process(t);
})
is much easier to grok and makes the function feel more natural than what is currently in place.
Proposed resolution
- Replace definition of
CJDB_NOEXCEPT_RETURNwith
#define CJDB_INJECT_LAMBDA(...) [&] __VA_ARGS__ ()
#define CJDB_DEDUCE_NOEXCEPT(...) \
noexcept(noexcept(CJDB_INJECT_LAMBDA(__VA_ARGS__))) \
{ return CJDB_INJECT_LAMBDA(__VA_ARGS__); }
- Replace all occurrences of
CJDB_NOEXCEPT_RETURNwithCJDB_DEDUCE_NOEXCEPT.