Befriend during runtime?

H

heelios.hantonei

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
 
Last edited by a moderator:
T

Thomas Tutone

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
 
J

Jay Nabonne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top