Commit 3a7cbbe4 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Fix the last issues with exception_wrapper under MSVC

Summary:
Well, MSVC 2017 anyways.
MSVC 2017 wasn't able to handle the decltype in the type specialization, which was also entirely unnecesary.

Reviewed By: yfeldblum

Differential Revision: D4880272

fbshipit-source-id: b6deed72a12d4b58d6eca200e7287e536f94ca30
parent b4bcc1a7
...@@ -21,32 +21,36 @@ ...@@ -21,32 +21,36 @@
namespace folly { namespace folly {
template <class Fn> template <class Fn>
struct exception_wrapper::arg_type2_ {}; struct exception_wrapper::arg_type_
: public arg_type_<decltype(&Fn::operator())> {
};
template <class Ret, class Class, class Arg> template <class Ret, class Class, class Arg>
struct exception_wrapper::arg_type2_<Ret (Class::*)(Arg)> { struct exception_wrapper::arg_type_<Ret (Class::*)(Arg)> {
using type = Arg; using type = Arg;
}; };
template <class Ret, class Class, class Arg> template <class Ret, class Class, class Arg>
struct exception_wrapper::arg_type2_<Ret (Class::*)(Arg) const> { struct exception_wrapper::arg_type_<Ret (Class::*)(Arg) const> {
using type = Arg;
};
template <class Ret, class Arg>
struct exception_wrapper::arg_type_<Ret (Arg)> {
using type = Arg;
};
template <class Ret, class Arg>
struct exception_wrapper::arg_type_<Ret (*)(Arg)> {
using type = Arg; using type = Arg;
}; };
template <class Ret, class Class> template <class Ret, class Class>
struct exception_wrapper::arg_type2_<Ret (Class::*)(...)> { struct exception_wrapper::arg_type_<Ret (Class::*)(...)> {
using type = AnyException; using type = AnyException;
}; };
template <class Ret, class Class> template <class Ret, class Class>
struct exception_wrapper::arg_type2_<Ret (Class::*)(...) const> { struct exception_wrapper::arg_type_<Ret (Class::*)(...) const> {
using type = AnyException; using type = AnyException;
}; };
template <class Ret>
template <class Fn, class> struct exception_wrapper::arg_type_<Ret (...)> {
struct exception_wrapper::arg_type_ {}; using type = AnyException;
template <class Fn>
struct exception_wrapper::arg_type_<Fn, void_t<decltype(&Fn::operator())>>
: public arg_type2_<decltype(&Fn::operator())> {};
template <class Ret, class Arg>
struct exception_wrapper::arg_type_<Ret (*)(Arg)> {
using type = Arg;
}; };
template <class Ret> template <class Ret>
struct exception_wrapper::arg_type_<Ret (*)(...)> { struct exception_wrapper::arg_type_<Ret (*)(...)> {
......
...@@ -168,8 +168,6 @@ class exception_wrapper final { ...@@ -168,8 +168,6 @@ class exception_wrapper final {
}; };
template <class Fn> template <class Fn>
struct arg_type2_;
template <class Fn, class = void>
struct arg_type_; struct arg_type_;
template <class Fn> template <class Fn>
using arg_type = _t<arg_type_<Fn>>; using arg_type = _t<arg_type_<Fn>>;
......
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