// PR c++/17132 template struct has_deref { struct impl { template < typename Type, typename Type::reference (Type::*Func)(void) const> struct func_tag; template static char (& test( Type *, func_tag * = 0 ))[2]; static char test(void *); }; static const bool value = (sizeof(impl::test((T *) 0)) == 2); }; template struct container { struct iterator { typedef T & reference; reference operator*() const; }; }; int main() { typedef container::iterator iter; int result = has_deref::value; return result; }