@@ -344,31 +344,25 @@ using requires_not_t = requires_t<Type, negation<disjunction<Traits...>>>;
344
344
// Impl: invoke/is_invocable
345
345
namespace impl_invoke {
346
346
347
- #pragma push_macro("RETURNS")
348
- #define RETURNS (...) \
349
- noexcept (noexcept (__VA_ARGS__))->decltype (__VA_ARGS__) { \
350
- return __VA_ARGS__; \
351
- } \
352
- static_assert (true , " " )
353
-
354
347
template <bool IsMemberObject, bool IsMemberFunction>
355
348
struct invoker {
356
349
template <typename F, typename ... Args>
357
350
constexpr static auto apply (F&& fun, Args&&... args)
358
- RETURNS (static_cast <F&&>(fun)(static_cast <Args&&>(args)...));
351
+ bsoncxx_returns (static_cast <F&&>(fun)(static_cast <Args&&>(args)...));
359
352
};
360
353
361
354
template <>
362
355
struct invoker <false , true > {
363
356
template <typename F, typename Self, typename ... Args>
364
357
constexpr static auto apply (F&& fun, Self&& self, Args&&... args)
365
- RETURNS ((static_cast <Self&&>(self).*fun)(static_cast <Args&&>(args)...));
358
+ bsoncxx_returns ((static_cast <Self&&>(self).*fun)(static_cast <Args&&>(args)...));
366
359
};
367
360
368
361
template <>
369
362
struct invoker <true , false > {
370
363
template <typename F, typename Self>
371
- constexpr static auto apply (F&& fun, Self&& self) RETURNS(static_cast <Self&&>(self).*fun);
364
+ constexpr static auto apply (F&& fun, Self&& self)
365
+ bsoncxx_returns(static_cast <Self&&>(self).*fun);
372
366
};
373
367
374
368
} // namespace impl_invoke
@@ -383,13 +377,11 @@ static constexpr struct invoke_fn {
383
377
384
378
template <typename F, typename ... Args, typename Fd = remove_cvref_t <F>>
385
379
constexpr auto operator ()(F&& fn, Args&&... args) const
386
- RETURNS (impl_invoke::invoker<std::is_member_object_pointer<Fd>::value,
387
- std::is_member_function_pointer<Fd>::value> //
388
- ::apply (static_cast <F&&>(fn), static_cast<Args&&>(args)...));
380
+ bsoncxx_returns (impl_invoke::invoker<std::is_member_object_pointer<Fd>::value,
381
+ std::is_member_function_pointer<Fd>::value> //
382
+ ::apply (static_cast <F&&>(fn), static_cast<Args&&>(args)...));
389
383
} invoke;
390
384
391
- #pragma pop_macro("RETURNS")
392
-
393
385
/* *
394
386
* @brief Yields the type that would result from invoking F with the given arguments.
395
387
*
0 commit comments