--- Comment #33 from gdr at integrable-solutions dot net 2006-05-01 19:02
---
Subject: Re: hidden declarations klobber STL
"bangerth at dealii dot org" <[EMAIL PROTECTED]> writes:
| I mean, it's a miracle your code actually does what you expect.
:-))
-- Gaby
--
http://gcc.gnu.
--- Comment #32 from gdr at integrable-solutions dot net 2006-05-01 18:59
---
Subject: Re: hidden declarations klobber STL
"pcarlini at suse dot de" <[EMAIL PROTECTED]> writes:
| --- Comment #14 from pcarlini at suse dot de 2006-04-20 09:37 ---
| (In reply to comment #12)
|
--- Comment #31 from gdr at integrable-solutions dot net 2006-05-01 18:55
---
Subject: Re: hidden declarations klobber STL
"pcarlini at suse dot de" <[EMAIL PROTECTED]> writes:
| Well, two comments: first, I cannot reproduce with current mainline. Second,
| frankly, if the implicatio
--- Comment #30 from pcarlini at suse dot de 2006-04-22 08:47 ---
(In reply to comment #28)
> template
> _OutputIterator
> fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
> {
> for (; __n > 0; --__n, ++__first)
[snip]
> template
> void f(W* p) { fill_n(mine1::mini_iter(
--- Comment #29 from pcarlini at suse dot de 2006-04-21 10:08 ---
(In reply to comment #28)
> Wolfgang: the whitspace paper is wonderful! Actually, Bjorne explains why
> operator,() was overloadable in the Rationale.
What about this:
http://public.research.att.com/~bs/whitespace.html
--- Comment #28 from igodard at pacbell dot net 2006-04-21 04:07 ---
Wolfgang: the whitspace paper is wonderful! Actually, Bjorne explains why
operator,() was overloadable in the Rationale.
I still think that there is a problem here. If you try to overload other
built-in operators in a
--- Comment #27 from pcarlini at suse dot de 2006-04-20 23:10 ---
(In reply to comment #23)
> Actually I don't see why the comma operator can be overridden in C++ (yes this
> I am raising a question about why the standards says it can).
Well, if we are talking about rationale and progra
--- Comment #26 from igodard at pacbell dot net 2006-04-20 19:15 ---
Sorry, fat fingered a submit before message was done, please ignore immediately
previous message. Corrected full one follows later
Ivan
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26974
--- Comment #25 from igodard at pacbell dot net 2006-04-20 18:40 ---
Wolfgang: the whitspace paper is wonderful! Actually, Bjorne explains why
operator,() was overloadable in the Rationale.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26974
--- Comment #24 from bangerth at dealii dot org 2006-04-20 18:16 ---
(In reply to comment #23)
> Actually I don't see why the comma operator can be overridden in C++ (yes this
> I am raising a question about why the standards says it can).
It was mid-March when Stroustrup developed oper
--- Comment #23 from pinskia at gcc dot gnu dot org 2006-04-20 16:24
---
Actually I don't see why the comma operator can be overridden in C++ (yes this
I am raising a question about why the standards says it can).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26974
--- Comment #22 from bangerth at dealii dot org 2006-04-20 14:10 ---
(In reply to comment #17)
> Yes, you pick up my operator in Wolfgang's test case. But in the original
> submission the vector code is *before* my operators, which are consequently
> out
> of scope for the STL code
Tha
--- Comment #21 from pcarlini at suse dot de 2006-04-20 11:59 ---
(In reply to comment #20)
std::fill_n could be made more robust
> restricting the second template argument,
Scratch this bit, sorry.
--
http://gcc.gnu.org/bugzilla/show_bug.c
--- Comment #20 from pcarlini at suse dot de 2006-04-20 11:56 ---
Everything considered, I don't think there is something to fix here, either in
the compiler (and all the other compilers I tried bahaves the same of current
g++ on Comment #18, irrespective of the position of the overloade
--- Comment #19 from pcarlini at suse dot de 2006-04-20 11:32 ---
By the way, I think I mentioned incorrectly ADL, which, in this specific case,
doesn't seem involved.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26974
--- Comment #18 from pcarlini at suse dot de 2006-04-20 10:20 ---
This is a self-contained example:
namespace mine1
{
struct mini_iter
{
mini_iter(int* p)
: _M_current(p) { }
int&
operator*() const
{ return *_M_current; }
mini_iter&
operator++()
{
--- Comment #17 from igodard at pacbell dot net 2006-04-20 09:58 ---
Yes, you pick up my operator in Wolfgang's test case. But in the original
submission the vector code is *before* my operators, which are consequently out
of scope for the STL code
--
http://gcc.gnu.org/bugzilla/sho
--- Comment #16 from igodard at pacbell dot net 2006-04-20 09:57 ---
Well, I don't see how the templating of the STL code can influence whether or
not my declarations are in scope or not.
BTAIM, my declarations are certainly inappropriate for what the STL is looking
for at the call site
--- Comment #15 from pcarlini at suse dot de 2006-04-20 09:56 ---
We can easily get a reference to the user defined operator, from the mainline
compiler with:
template
int operator,(int i, T t) { return i; }
#include
int main()
{
std::vector v;
std::fill_n(v.begin(), 0, 1);
}
--- Comment #14 from pcarlini at suse dot de 2006-04-20 09:37 ---
(In reply to comment #12)
> I don't think that the problem is in the STL. The STL can be as tricky as it
> wants, including use of operator,(). It should not be possible for the actual
> operator,()s I declared to hijack t
--- Comment #13 from igodard at pacbell dot net 2006-04-20 09:31 ---
p.s. Another requirement for the failure probably is that the second
declaration has to be a templated operator,() of the form I used i.e. right
argument a free template argument.
Ivan
--
http://gcc.gnu.org/bugzil
--- Comment #12 from igodard at pacbell dot net 2006-04-20 09:28 ---
I don't think that the problem is in the STL. The STL can be as tricky as it
wants, including use of operator,(). It should not be possible for the actual
operator,()s I declared to hijack the STL the way that happened,
--- Comment #11 from pcarlini at suse dot de 2006-04-20 09:25 ---
(In reply to comment #10)
Before closing this I'm only curious
to
> know why mainline is fine, maybe, simply, ADL was too zelant here? Any
> language
> lawyer kicking in?
The rea
--- Comment #10 from pcarlini at suse dot de 2006-04-20 09:10 ---
Well, two comments: first, I cannot reproduce with current mainline. Second,
frankly, if the implication of the issue is that in the entire implementation
of we cannot use operator, only to allow the user to write
unrestr
--- Comment #9 from igodard at pacbell dot net 2006-04-20 08:20 ---
I believe it is a bug because my declaration should not be able to hijack the
use inside the STL, which should only be seeing the declarations that were
visible where the STL function was defined, which did not include a
--- Comment #8 from bangerth at dealii dot org 2006-04-20 04:13 ---
Thinking about it some more, I can come up with something. Take this
code here:
-
class specReg{};
template
int operator,(int i, T t) { abort(); return i; }
#include
int main()
{
std::vector v;
26 matches
Mail list logo