Commit efaea239 authored by Christos Stratopoulos's avatar Christos Stratopoulos Committed by Facebook Github Bot

handle noexcept in SignatureOf_ and ArgTypes_ (#1173)

Summary:
Fixes https://github.com/facebook/folly/issues/737

My use of `std::add_pointer_t` deviates in style from the alias decls in other `SignatureOf_` specializations because it is not possible with that syntax to declare a pointer to `noexcept` function.
Pull Request resolved: https://github.com/facebook/folly/pull/1173

Reviewed By: yfeldblum

Differential Revision: D15906742

Pulled By: Orvid

fbshipit-source-id: bb2af75d24d620f80b26ca4daa579e244be0e6a8
parent 4dedb180
......@@ -404,6 +404,17 @@ struct SignatureOf_<R (C::*)(As...) const, I> {
using type = Ret<R, I> (*)(Data const&, Arg<As, I>...);
};
template <class R, class C, class... As, class I>
struct SignatureOf_<R (C::*)(As...) noexcept, I> {
using type = std::add_pointer_t<Ret<R, I>(Data&, Arg<As, I>...) noexcept>;
};
template <class R, class C, class... As, class I>
struct SignatureOf_<R (C::*)(As...) const noexcept, I> {
using type =
std::add_pointer_t<Ret<R, I>(Data const&, Arg<As, I>...) noexcept>;
};
template <class R, class This, class... As, class I>
struct SignatureOf_<R (*)(This&, As...), I> {
using type = Ret<R, I> (*)(Data&, Arg<As, I>...);
......@@ -425,6 +436,11 @@ struct ArgTypes_<User, I, Ret (*)(Data, Args...)> {
using type = TypeList<Args...>;
};
template <FOLLY_AUTO User, class I, class Ret, class Data, class... Args>
struct ArgTypes_<User, I, Ret (*)(Data, Args...) noexcept> {
using type = TypeList<Args...>;
};
template <FOLLY_AUTO User, class I>
using ArgTypes = _t<ArgTypes_<User, I>>;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment