cjdb-ranges icon indicating copy to clipboard operation
cjdb-ranges copied to clipboard

Replace CJDB_NOEXCEPT_RETURN with proposed CJDB_DEDUCE_NOEXCEPT

Open cjdb opened this issue 5 years ago • 0 comments

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

  1. Replace definition of CJDB_NOEXCEPT_RETURN with
#define CJDB_INJECT_LAMBDA(...) [&] __VA_ARGS__ ()

#define CJDB_DEDUCE_NOEXCEPT(...)                   \
noexcept(noexcept(CJDB_INJECT_LAMBDA(__VA_ARGS__))) \
{ return CJDB_INJECT_LAMBDA(__VA_ARGS__); }
  1. Replace all occurrences of CJDB_NOEXCEPT_RETURN with CJDB_DEDUCE_NOEXCEPT.

cjdb avatar Dec 14 '19 11:12 cjdb