0

hi,

just want to ask, is it possible to restrict friend acess to a single class member function only?

in other words, if class A grant class B friend access to class A member function, then class B can call that class A function.

*note: this is suppose to be a workaround to the inability (my own) to pass class member function pointers into another class.

thanks in advance!

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by dkalita
0

hi,

just want to ask, is it possible to restrict friend acess to a single class member function only?

in other words, if class A grant class B friend access to class A member function, then class B can call that class A function.

*note: this is suppose to be a workaround to the inability (my own) to pass class member function pointers into another class.

thanks in advance!

nope. A friend class can access all the members of a class.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.