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

Don't use std::void_t

Summary: I was wrong, MSVC's implementation has the same bug as everything else.

Reviewed By: yfeldblum

Differential Revision: D5810646

fbshipit-source-id: 9caabbbc2115f57b7e836bb85c9b108588c94ad9
parent d3555e67
...@@ -174,9 +174,9 @@ using _t = typename T::type; ...@@ -174,9 +174,9 @@ using _t = typename T::type;
*/ */
/** /**
* There is a bug in gcc that causes it to ignore unused template parameter * There is a bug in libstdc++, libc++, and MSVC's STL that causes it to
* arguments in template aliases and does not cause substitution failures. * ignore unused template parameter arguments in template aliases and does not
* This defect has been recorded here: * cause substitution failures. This defect has been recorded here:
* http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558. * http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558.
* *
* This causes the implementation of std::void_t to be buggy, as it is likely * This causes the implementation of std::void_t to be buggy, as it is likely
...@@ -201,16 +201,7 @@ using _t = typename T::type; ...@@ -201,16 +201,7 @@ using _t = typename T::type;
* The second foo() will be a redefinition because it conflicts with the first * The second foo() will be a redefinition because it conflicts with the first
* one; void_t does not cause substitution failures - the template types are * one; void_t does not cause substitution failures - the template types are
* just ignored. * just ignored.
*
* Till then only the non-buggy MSVC std::void_t can be used, and for the rest
* folly::void_t will continue to be used because it does not use unnamed
* template parameters for the top level implementation of void_t.
*/ */
#if defined(_MSC_VER)
/* using override */ using std::void_t;
#else // defined(_MSC_VER)
namespace traits_detail { namespace traits_detail {
template <class...> template <class...>
...@@ -222,8 +213,6 @@ struct void_t_ { ...@@ -222,8 +213,6 @@ struct void_t_ {
template <class... Ts> template <class... Ts>
using void_t = _t<traits_detail::void_t_<Ts...>>; using void_t = _t<traits_detail::void_t_<Ts...>>;
#endif // defined(_MSC_VER)
/** /**
* IsRelocatable<T>::value describes the ability of moving around * IsRelocatable<T>::value describes the ability of moving around
* memory a value of type T by using memcpy (as opposed to the * memory a value of type T by using memcpy (as opposed to the
......
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