On 18/01/2008, Dragan Milenkovic <[EMAIL PROTECTED]> wrote:
>
> Thanks for clarification and info. I believe issue #34 addresses exactly
> what we're talking about.
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#34
Aha, yes ... but strangely that seems to have been closed as
Not-A
Jonathan Wakely wrote:
On 17/01/2008, Richard Guenther wrote:
Well, a language lawyer can probably clear things up. From a look
at the std it looks like w/o a previous declaration the above should
be invalid. And at a different point it suggests the decl becomes
available.
Yes, at the point
On 18/01/2008, Jonathan Wakely <[EMAIL PROTECTED]> wrote:
>
> Yes, at the point of instantiation of Foo the friend is declared,
> and can then be found by ADL because Foo is an associated type.
> The reference parameter 'x' doesn't cause an instantiation, only 'weird' does.
Forgot the reference -
On 17/01/2008, Richard Guenther wrote:
>
> Well, a language lawyer can probably clear things up. From a look
> at the std it looks like w/o a previous declaration the above should
> be invalid. And at a different point it suggests the decl becomes
> available.
Yes, at the point of instantiation
On 17 Jan 2008 11:46:52 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote:
>
> "Richard Guenther" <[EMAIL PROTECTED]> writes:
> >
> > Well, first I think you'd need friend-injection or otherwise a global
> > decl of the function.
>
> ADL works without friend injection. Look at 3.4.2
> [basic.looku
"Richard Guenther" <[EMAIL PROTECTED]> writes:
> > > On Jan 17, 2008 2:12 PM, Dragan Milenkovic <[EMAIL PROTECTED]> wrote:
> > > > Richard Guenther wrote:
> > > > [snip]
> > > > >> template
> > > > >> struct Foo
> > > > >> {
> > > > >> template
> > > > >> friend void func(const Foo &);
On 17 Jan 2008 09:09:38 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote:
>
> "Richard Guenther" <[EMAIL PROTECTED]> writes:
>
> > On Jan 17, 2008 2:12 PM, Dragan Milenkovic <[EMAIL PROTECTED]> wrote:
> > > Richard Guenther wrote:
> > > [snip]
> > > >> template
> > > >> struct Foo
> > > >> {
> >
"Richard Guenther" <[EMAIL PROTECTED]> writes:
> On Jan 17, 2008 2:12 PM, Dragan Milenkovic <[EMAIL PROTECTED]> wrote:
> > Richard Guenther wrote:
> > [snip]
> > >> template
> > >> struct Foo
> > >> {
> > >> template
> > >> friend void func(const Foo &);
> > >> };
> > >>
> > >> void ch
On Jan 17, 2008 2:12 PM, Dragan Milenkovic <[EMAIL PROTECTED]> wrote:
> Richard Guenther wrote:
> [snip]
> >> template
> >> struct Foo
> >> {
> >> template
> >> friend void func(const Foo &);
> >> };
> >>
> >> void check(const Foo & x)
> >> {
> >> // Foo weird; // uncomment this l
template
struct Foo
{
template
friend void func(const Foo &);
};
void check(const Foo & x)
{
// Foo weird; // uncomment this line and all works
func(x);// <-- ERROR
}
Tested with gcc 4.0 - 4.3, and all behave the same:
"error: 'func' was not declared in this scope
Richard Guenther wrote:
[snip]
template
struct Foo
{
template
friend void func(const Foo &);
};
void check(const Foo & x)
{
// Foo weird; // uncomment this line and all works
func(x);// <-- ERROR
}
Tested with gcc 4.0 - 4.3, and all behave the same:
"error: 'func'
On Jan 17, 2008 11:44 AM, Dragan Milenkovic <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm aware about these issues being around for quite a while now, but
> there is still a chance this sample code can be helpful. I apologize
> if someone gets annoyed :-P
>
>
> template
> struct Foo
> {
> templ
Hello,
I'm aware about these issues being around for quite a while now, but
there is still a chance this sample code can be helpful. I apologize
if someone gets annoyed :-P
template
struct Foo
{
template
friend void func(const Foo &);
};
void check(const Foo & x)
{
// Foo weird;
13 matches
Mail list logo