You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/07/24 19:33:31 UTC
[jira] Created: (STDCXX-500) 1 + std::deque::iterator ambiguous
without debugging iterators
1 + std::deque::iterator ambiguous without debugging iterators
--------------------------------------------------------------
Key: STDCXX-500
URL: https://issues.apache.org/jira/browse/STDCXX-500
Project: C++ Standard Library
Issue Type: Bug
Components: 24. Iterators
Affects Versions: 4.1.3
Environment: HP aCC 6.0
Reporter: Martin Sebor
Moved from Rogue Wave Bugzilla: http://bugzilla.cvo.roguewave.com/show_bug.cgi?id=1923
-------- Original Message --------
Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
Date: Mon, 18 Apr 2005 18:12:41 -0700 (PDT)
From: Dennis Handly <dh...@cup.hp.com>
To: dhandly@cup.hp.com, sebor@roguewave.com
CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
>From: Dennis Handly <dh...@cup.hp.com>
>Or use deque directly:
template <class _TypeT, class _Allocator>
inline typename deque<_TypeT, _Allocator>::iterator
operator+(typename deque<_TypeT,
_Allocator>::iterator::difference_type __n,
typename deque<_TypeT, _Allocator>::iterator __rhs)
{
return __rhs.operator+(__n);
}
This didn't work. I need to also have one for const_iterator.
And it seems the test is bad:
error #2349: no operator "+" matches these operands
operand types are: int + std::deque<char,
std::allocator<char>>::const_iterator
2+it04
^
24(9) says that "n denotes a value of difference type Distance".
So that this has to be "2L". Or better yet:
...:iterator::difference_type(2) + it04
Does this seem like something we can get Perennial to change?
Boris:
Do we know how those other STLs work? Do they have an extra int
overloading?
------- Additional Comments From sebor@roguewave.com 2005-04-19 09:30:12 ----
-------- Original Message --------
Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
Date: Tue, 19 Apr 2005 10:29:32 -0600
From: Martin Sebor <se...@roguewave.com>
To: Dennis Handly <dh...@cup.hp.com>
CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
References: <20...@hpcll183.cup.hp.com>
Dennis Handly wrote:
>>From: Dennis Handly <dh...@cup.hp.com>
>>Or use deque directly:
>
> template <class _TypeT, class _Allocator>
> inline typename deque<_TypeT, _Allocator>::iterator
> operator+(typename deque<_TypeT,
_Allocator>::iterator::difference_type __n,
> typename deque<_TypeT, _Allocator>::iterator __rhs)
> {
> return __rhs.operator+(__n);
> }
>
> This didn't work. I need to also have one for const_iterator.
>
> And it seems the test is bad:
> error #2349: no operator "+" matches these operands
> operand types are: int + std::deque<char,
> std::allocator<char>>::const_iterator
> 2+it04
> ^
>
> 24(9) says that "n denotes a value of difference type Distance".
Ah. That's because the type of 2 is int but deque iterator's
distance type (that the iterator's type depends on) is long.
Darn! Those templates, they always get you! I'll have to think
about this one some more. I created bug 1923 to remind me.
>
> So that this has to be "2L". Or better yet:
> ...:iterator::difference_type(2) + it04
>
> Does this seem like something we can get Perennial to change?
Strictly speaking I think the test is incorrect. 24.1, p1 says
that n (used in Table 76) denotes a value of the difference type
Distance, but 2 is not. But as a matter of QoI any integer should
work.
Martin
------- Additional Comments From sebor@roguewave.com 2005-04-19 09:31:08 ----
Here's the test case:
$ cat t.cpp && aCC -AA -V -c t.cpp
#include <deque>
void foo (std::deque<char>::const_iterator i)
{
i + 2;
2 + i;
}
aCC: HP aC++/ANSI C B3910B A.06.00 [Aug 25 2004]
"t.cpp", line 6: error #2349: no operator "+" matches these operands
operand types are: int + std::deque<char,
std::allocator<char>>::const_iterator
2 + i;
^
1 error detected in the compilation of "t.cpp".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-500) 1 + std::deque::iterator ambiguous
without debugging iterators
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor updated STDCXX-500:
--------------------------------
Severity: Compiler Error
Affects Version/s: 4.2.0
Fix Version/s: 4.2.1
Added 4.2.0 to Affected Versions, scheduled for 4.2.1 and assigned to Travis.
> 1 + std::deque::iterator ambiguous without debugging iterators
> --------------------------------------------------------------
>
> Key: STDCXX-500
> URL: https://issues.apache.org/jira/browse/STDCXX-500
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 24. Iterators
> Affects Versions: 4.1.3, 4.2.0
> Environment: HP aCC 6.0
> Reporter: Martin Sebor
> Fix For: 4.2.1
>
>
> Moved from Rogue Wave Bugzilla: http://bugzilla.cvo.roguewave.com/show_bug.cgi?id=1923
> -------- Original Message --------
> Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
> Date: Mon, 18 Apr 2005 18:12:41 -0700 (PDT)
> From: Dennis Handly <dh...@cup.hp.com>
> To: dhandly@cup.hp.com, sebor@roguewave.com
> CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
> >From: Dennis Handly <dh...@cup.hp.com>
> >Or use deque directly:
> template <class _TypeT, class _Allocator>
> inline typename deque<_TypeT, _Allocator>::iterator
> operator+(typename deque<_TypeT,
> _Allocator>::iterator::difference_type __n,
> typename deque<_TypeT, _Allocator>::iterator __rhs)
> {
> return __rhs.operator+(__n);
> }
> This didn't work. I need to also have one for const_iterator.
> And it seems the test is bad:
> error #2349: no operator "+" matches these operands
> operand types are: int + std::deque<char,
> std::allocator<char>>::const_iterator
> 2+it04
> ^
> 24(9) says that "n denotes a value of difference type Distance".
> So that this has to be "2L". Or better yet:
> ...:iterator::difference_type(2) + it04
> Does this seem like something we can get Perennial to change?
> Boris:
> Do we know how those other STLs work? Do they have an extra int
> overloading?
> ------- Additional Comments From sebor@roguewave.com 2005-04-19 09:30:12 ----
> -------- Original Message --------
> Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
> Date: Tue, 19 Apr 2005 10:29:32 -0600
> From: Martin Sebor <se...@roguewave.com>
> To: Dennis Handly <dh...@cup.hp.com>
> CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
> References: <20...@hpcll183.cup.hp.com>
> Dennis Handly wrote:
> >>From: Dennis Handly <dh...@cup.hp.com>
> >>Or use deque directly:
> >
> > template <class _TypeT, class _Allocator>
> > inline typename deque<_TypeT, _Allocator>::iterator
> > operator+(typename deque<_TypeT,
> _Allocator>::iterator::difference_type __n,
> > typename deque<_TypeT, _Allocator>::iterator __rhs)
> > {
> > return __rhs.operator+(__n);
> > }
> >
> > This didn't work. I need to also have one for const_iterator.
> >
> > And it seems the test is bad:
> > error #2349: no operator "+" matches these operands
> > operand types are: int + std::deque<char,
> > std::allocator<char>>::const_iterator
> > 2+it04
> > ^
> >
> > 24(9) says that "n denotes a value of difference type Distance".
> Ah. That's because the type of 2 is int but deque iterator's
> distance type (that the iterator's type depends on) is long.
> Darn! Those templates, they always get you! I'll have to think
> about this one some more. I created bug 1923 to remind me.
> >
> > So that this has to be "2L". Or better yet:
> > ...:iterator::difference_type(2) + it04
> >
> > Does this seem like something we can get Perennial to change?
> Strictly speaking I think the test is incorrect. 24.1, p1 says
> that n (used in Table 76) denotes a value of the difference type
> Distance, but 2 is not. But as a matter of QoI any integer should
> work.
> Martin
> ------- Additional Comments From sebor@roguewave.com 2005-04-19 09:31:08 ----
> Here's the test case:
> $ cat t.cpp && aCC -AA -V -c t.cpp
> #include <deque>
> void foo (std::deque<char>::const_iterator i)
> {
> i + 2;
> 2 + i;
> }
> aCC: HP aC++/ANSI C B3910B A.06.00 [Aug 25 2004]
> "t.cpp", line 6: error #2349: no operator "+" matches these operands
> operand types are: int + std::deque<char,
> std::allocator<char>>::const_iterator
> 2 + i;
> ^
> 1 error detected in the compilation of "t.cpp".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-500) 1 + std::deque::iterator ambiguous
without debugging iterators
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533824 ]
Martin Sebor commented on STDCXX-500:
-------------------------------------
My guess is that distance_type is an alias for int on MSVC/Windows and gcc/Linux.
Try this:
#include <deque>
void foo (std::deque<char>::const_iterator i)
{
i + '\0';
'\0' + i;
i + (short)1;
(short)1 + i;
i + 2;
2 + i;
i + 3L;
3L + i;
}
int main () { }
> 1 + std::deque::iterator ambiguous without debugging iterators
> --------------------------------------------------------------
>
> Key: STDCXX-500
> URL: https://issues.apache.org/jira/browse/STDCXX-500
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 24. Iterators
> Affects Versions: 4.1.3
> Environment: HP aCC 6.0
> Reporter: Martin Sebor
>
> Moved from Rogue Wave Bugzilla: http://bugzilla.cvo.roguewave.com/show_bug.cgi?id=1923
> -------- Original Message --------
> Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
> Date: Mon, 18 Apr 2005 18:12:41 -0700 (PDT)
> From: Dennis Handly <dh...@cup.hp.com>
> To: dhandly@cup.hp.com, sebor@roguewave.com
> CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
> >From: Dennis Handly <dh...@cup.hp.com>
> >Or use deque directly:
> template <class _TypeT, class _Allocator>
> inline typename deque<_TypeT, _Allocator>::iterator
> operator+(typename deque<_TypeT,
> _Allocator>::iterator::difference_type __n,
> typename deque<_TypeT, _Allocator>::iterator __rhs)
> {
> return __rhs.operator+(__n);
> }
> This didn't work. I need to also have one for const_iterator.
> And it seems the test is bad:
> error #2349: no operator "+" matches these operands
> operand types are: int + std::deque<char,
> std::allocator<char>>::const_iterator
> 2+it04
> ^
> 24(9) says that "n denotes a value of difference type Distance".
> So that this has to be "2L". Or better yet:
> ...:iterator::difference_type(2) + it04
> Does this seem like something we can get Perennial to change?
> Boris:
> Do we know how those other STLs work? Do they have an extra int
> overloading?
> ------- Additional Comments From sebor@roguewave.com 2005-04-19 09:30:12 ----
> -------- Original Message --------
> Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
> Date: Tue, 19 Apr 2005 10:29:32 -0600
> From: Martin Sebor <se...@roguewave.com>
> To: Dennis Handly <dh...@cup.hp.com>
> CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
> References: <20...@hpcll183.cup.hp.com>
> Dennis Handly wrote:
> >>From: Dennis Handly <dh...@cup.hp.com>
> >>Or use deque directly:
> >
> > template <class _TypeT, class _Allocator>
> > inline typename deque<_TypeT, _Allocator>::iterator
> > operator+(typename deque<_TypeT,
> _Allocator>::iterator::difference_type __n,
> > typename deque<_TypeT, _Allocator>::iterator __rhs)
> > {
> > return __rhs.operator+(__n);
> > }
> >
> > This didn't work. I need to also have one for const_iterator.
> >
> > And it seems the test is bad:
> > error #2349: no operator "+" matches these operands
> > operand types are: int + std::deque<char,
> > std::allocator<char>>::const_iterator
> > 2+it04
> > ^
> >
> > 24(9) says that "n denotes a value of difference type Distance".
> Ah. That's because the type of 2 is int but deque iterator's
> distance type (that the iterator's type depends on) is long.
> Darn! Those templates, they always get you! I'll have to think
> about this one some more. I created bug 1923 to remind me.
> >
> > So that this has to be "2L". Or better yet:
> > ...:iterator::difference_type(2) + it04
> >
> > Does this seem like something we can get Perennial to change?
> Strictly speaking I think the test is incorrect. 24.1, p1 says
> that n (used in Table 76) denotes a value of the difference type
> Distance, but 2 is not. But as a matter of QoI any integer should
> work.
> Martin
> ------- Additional Comments From sebor@roguewave.com 2005-04-19 09:31:08 ----
> Here's the test case:
> $ cat t.cpp && aCC -AA -V -c t.cpp
> #include <deque>
> void foo (std::deque<char>::const_iterator i)
> {
> i + 2;
> 2 + i;
> }
> aCC: HP aC++/ANSI C B3910B A.06.00 [Aug 25 2004]
> "t.cpp", line 6: error #2349: no operator "+" matches these operands
> operand types are: int + std::deque<char,
> std::allocator<char>>::const_iterator
> 2 + i;
> ^
> 1 error detected in the compilation of "t.cpp".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-500) 1 + std::deque::iterator ambiguous
without debugging iterators
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533802 ]
Farid Zaripov commented on STDCXX-500:
--------------------------------------
Could not reproduce this issue on MSVC8 and gcc 4.2.0/Linux.
> 1 + std::deque::iterator ambiguous without debugging iterators
> --------------------------------------------------------------
>
> Key: STDCXX-500
> URL: https://issues.apache.org/jira/browse/STDCXX-500
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 24. Iterators
> Affects Versions: 4.1.3
> Environment: HP aCC 6.0
> Reporter: Martin Sebor
>
> Moved from Rogue Wave Bugzilla: http://bugzilla.cvo.roguewave.com/show_bug.cgi?id=1923
> -------- Original Message --------
> Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
> Date: Mon, 18 Apr 2005 18:12:41 -0700 (PDT)
> From: Dennis Handly <dh...@cup.hp.com>
> To: dhandly@cup.hp.com, sebor@roguewave.com
> CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
> >From: Dennis Handly <dh...@cup.hp.com>
> >Or use deque directly:
> template <class _TypeT, class _Allocator>
> inline typename deque<_TypeT, _Allocator>::iterator
> operator+(typename deque<_TypeT,
> _Allocator>::iterator::difference_type __n,
> typename deque<_TypeT, _Allocator>::iterator __rhs)
> {
> return __rhs.operator+(__n);
> }
> This didn't work. I need to also have one for const_iterator.
> And it seems the test is bad:
> error #2349: no operator "+" matches these operands
> operand types are: int + std::deque<char,
> std::allocator<char>>::const_iterator
> 2+it04
> ^
> 24(9) says that "n denotes a value of difference type Distance".
> So that this has to be "2L". Or better yet:
> ...:iterator::difference_type(2) + it04
> Does this seem like something we can get Perennial to change?
> Boris:
> Do we know how those other STLs work? Do they have an extra int
> overloading?
> ------- Additional Comments From sebor@roguewave.com 2005-04-19 09:30:12 ----
> -------- Original Message --------
> Subject: Re: FWD: Peren 6.4 and N + iterator & swap(deque, deque)
> Date: Tue, 19 Apr 2005 10:29:32 -0600
> From: Martin Sebor <se...@roguewave.com>
> To: Dennis Handly <dh...@cup.hp.com>
> CC: Boris.Gubenko@hp.com, mahesha@india.hp.com, sgganesh@india.hp.com
> References: <20...@hpcll183.cup.hp.com>
> Dennis Handly wrote:
> >>From: Dennis Handly <dh...@cup.hp.com>
> >>Or use deque directly:
> >
> > template <class _TypeT, class _Allocator>
> > inline typename deque<_TypeT, _Allocator>::iterator
> > operator+(typename deque<_TypeT,
> _Allocator>::iterator::difference_type __n,
> > typename deque<_TypeT, _Allocator>::iterator __rhs)
> > {
> > return __rhs.operator+(__n);
> > }
> >
> > This didn't work. I need to also have one for const_iterator.
> >
> > And it seems the test is bad:
> > error #2349: no operator "+" matches these operands
> > operand types are: int + std::deque<char,
> > std::allocator<char>>::const_iterator
> > 2+it04
> > ^
> >
> > 24(9) says that "n denotes a value of difference type Distance".
> Ah. That's because the type of 2 is int but deque iterator's
> distance type (that the iterator's type depends on) is long.
> Darn! Those templates, they always get you! I'll have to think
> about this one some more. I created bug 1923 to remind me.
> >
> > So that this has to be "2L". Or better yet:
> > ...:iterator::difference_type(2) + it04
> >
> > Does this seem like something we can get Perennial to change?
> Strictly speaking I think the test is incorrect. 24.1, p1 says
> that n (used in Table 76) denotes a value of the difference type
> Distance, but 2 is not. But as a matter of QoI any integer should
> work.
> Martin
> ------- Additional Comments From sebor@roguewave.com 2005-04-19 09:31:08 ----
> Here's the test case:
> $ cat t.cpp && aCC -AA -V -c t.cpp
> #include <deque>
> void foo (std::deque<char>::const_iterator i)
> {
> i + 2;
> 2 + i;
> }
> aCC: HP aC++/ANSI C B3910B A.06.00 [Aug 25 2004]
> "t.cpp", line 6: error #2349: no operator "+" matches these operands
> operand types are: int + std::deque<char,
> std::allocator<char>>::const_iterator
> 2 + i;
> ^
> 1 error detected in the compilation of "t.cpp".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.