lkml.org 
[lkml]   [1999]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: C++ in kernel (was Re: exception in a device driver)
Date
From
And lo, Alan Cox saith unto me:
>
> > The rest is FUD: it's trivial to "figure out" when you are passing a
> > "self" pointer argument around: only non-static member functions have
> > them.
>
> On the contrary
Read the message: it doesn't say the compiler will notice and not pass
the "self" pointer. That's your job.

> foo1.C
>
> blah->foofunc();
>
>
> foo2.C
>
> blahobject::foofunc()
> {
> printf("Hi");
> }
>
foo3.C

blahkid::foofunc()
{
printf("%d",some_member_data);
}

foo3.C *needs* the "self" pointer you are so worried about. If you want
to prevent the self pointer from being passed, make it a non-member function
or make it a static member function, and stop complaining...or depending
on what foofunc is notionally supposed to do, leave it non-static so the
writers of child classes don't have to fix it for you.

Better yet, whenever you don't know a language well enough to use it at the
level you expect of yourself, spend the time to learn it, lest your code
disappoint you or your toes not match your culinary standards.

Keith


--
"Well, look at that. The sun's | Linux: http://www.linuxhq.com |"Zooty,
coming up." -- John Sheridan, | KDE: http://www.kde.org | zoot
"Sleeping in Light", Babylon 5 | Keith: kwrohrer@enteract.com | zoot!"
www.midwinter.com/lurk/lurker.html | http://www.enteract.com/~kwrohrer | --Rebo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.080 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site