[Bug c++/17057] problems disambiguating std::allocator::rebind
gdr at integrable-solutions dot net
gcc-bugzilla@gcc.gnu.org
Wed Aug 18 22:19:00 GMT 2004
------- Additional Comments From gdr at integrable-solutions dot net 2004-08-18 22:18 -------
Subject: Re: problems disambiguating std::allocator::rebind
"bkoz at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| To recap:
|
| template<typename _Tp, typename _PoolTp>
| class __mt_alloc : public _PoolTp
| {
| public:
|
| template<typename _Tp1, typename _PoolTp1 = _PoolTp>
| struct rebind
| {
| #if 1
| // ok with edg
| typedef _PoolTp1::_M_rebind<_Tp1>::other pool_type;
This is wrong. Missing infamous "::template" and "typename".
| #else
| // as g++ suggests but cannot compile
| typedef _PoolTp1::template _M_rebind<_Tp1>::other pool_type;
This is wron. Missing infamous "typename".
| #endif
| typedef __mt_alloc<_Tp1, pool_type> other;
| };
| };
|
| None of these work with g++. If I just keep on adding junk, say
|
| typedef typename _PoolTp1::template _M_rebind<_Tp1>::other pool_type;
This junk is correct standard way to write it
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17057
More information about the Gcc-bugs
mailing list