#include <iostream>
#include <type_traits>
#include <map>
template<int C>
struct Test
{
auto blah() const
-> typename std::enable_if
<
C == 1,
bool
>::type
{
return false;
}
};
int main()
{
std::map<int, Test<0>> meh;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+CiNpbmNsdWRlIDxtYXA+Cgp0ZW1wbGF0ZTxpbnQgQz4Kc3RydWN0IFRlc3QKewoJYXV0byBibGFoKCkgY29uc3QKCS0+IHR5cGVuYW1lIHN0ZDo6ZW5hYmxlX2lmCgk8CgkJQyA9PSAxLAoJCWJvb2wKCT46OnR5cGUKCXsKCQlyZXR1cm4gZmFsc2U7Cgl9Cn07CgppbnQgbWFpbigpCnsKCXN0ZDo6bWFwPGludCwgVGVzdDwwPj4gbWVoOwp9Cg==
prog.cpp: In instantiation of ‘struct Test<0>’:
/usr/include/c++/4.8/bits/stl_pair.h:102:11: required from ‘struct std::pair<const int, Test<0> >’
/usr/include/c++/4.8/bits/stl_tree.h:134:12: required from ‘struct std::_Rb_tree_node<std::pair<const int, Test<0> > >’
/usr/include/c++/4.8/bits/stl_tree.h:1125:25: required from ‘void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_erase(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type) [with _Key = int; _Val = std::pair<const int, Test<0> >; _KeyOfValue = std::_Select1st<std::pair<const int, Test<0> > >; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, Test<0> > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const int, Test<0> > >*]’
/usr/include/c++/4.8/bits/stl_tree.h:671:28: required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::~_Rb_tree() [with _Key = int; _Val = std::pair<const int, Test<0> >; _KeyOfValue = std::_Select1st<std::pair<const int, Test<0> > >; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, Test<0> > >]’
/usr/include/c++/4.8/bits/stl_map.h:96:11: required from here
prog.cpp:8:7: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
auto blah() const
^