[Bug c++/53039] [4.7/4.8 Regression] including <functional> breaks std::is_convertible with template-pack expansion
paolo.carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Fri Apr 20 10:27:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53039
--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-20 10:27:11 UTC ---
Eh, this is *not* a library issue:
#include <type_traits>
#if 1
template<typename... _Elements>
class tuple
{
template<typename... _UElements, typename = typename
std::enable_if<std::__and_<std::is_convertible<_UElements,
_Elements>...>::value>::type>
tuple(_UElements&&...);
};
#else
template<typename _Elements>
class tuple1
{
template<typename _UElements, typename = typename
std::enable_if<std::__and_<std::is_convertible<_UElements,
_Elements>>::value>::type>
tuple1(_UElements&&);
};
#endif
template <bool...>
struct Bs
{
static const bool value = true;
};
template <typename... Ts>
struct AType {
template <typename... Us,
typename std::enable_if<
Bs<std::is_convertible<Us, Ts>::value...>::value,
bool>::type = false
>
int foo(Us&&...)
{
return sizeof...(Us);
}
};
int main() {
AType<int, int> t;
return t.foo(1, 1);
}
More information about the Gcc-bugs
mailing list