|
-
Jul 21st, 2001, 11:25 AM
#1
Thread Starter
transcendental analytic
friend templates
How do I make all instances of a template, friend to a class. I tried deriving a base class which I made a friend of, but I don't want to call the base class static functions to access every friendly class members, first it's a pain in the ass and second you don't get the feeling of OOP, there has to be another way?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 23rd, 2001, 02:08 PM
#2
Guru
Doesn't this work?
Code:
class A {};
template <typename T>
class B
{
friend class A;
};
-
Jul 23rd, 2001, 03:41 PM
#3
Thread Starter
transcendental analytic
quite opposite
more like
Code:
class A {
friend template B;
};
template <typename T>
class B {};
but is it possible, if so how?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|