This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17057] problems disambiguating std::allocator::rebind
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Aug 2004 22:19:00 -0000
- Subject: [Bug c++/17057] problems disambiguating std::allocator::rebind
- References: <20040817040042.17057.bkoz@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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