By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,412 Members | 1,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,412 IT Pros & Developers. It's quick & easy.

Befriend during runtime?

P: n/a
Hi,

I'm currently writting an application and I was wondering if there was
a way to declare a class friend of another during runtime?

Thanks.
Philippe Gagnon

Dec 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
he**************@gmail.com wrote:
I'm currently writting an application and I was wondering if there was
a way to declare a class friend of another during runtime?


No, there isn't. Why do you want to? Perhaps there is another way of
accomplishing what you need to do.

Best regards,

Tom

Dec 23 '05 #2

P: n/a
On Thu, 22 Dec 2005 20:27:38 -0800, he**************@gmail.com wrote:
Hi,

I'm currently writting an application and I was wondering if there was
a way to declare a class friend of another during runtime?


Could you explain what that means? Friendship (in the C++ sense) is about
being able to grant access rights during compilation to allow access to
private and/or protected elements of a class. If the class isn't a friend
class at compile time, you can't compile the code, which means there *is
no code* accessing the class that you can even grant access to at runtime.

So even if you could somehow declare the class a friend, what does it
practically gain you, since you can't go back and compile the code you
need?

- Jay

Dec 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.