A
anongroupaccount
I have a smaller class that essentially acts as a record for a larger
class (stored in a vector inside of the larger class). In a sense, it's
splitting functionality over two classes.
I don't want any other classes to be able to use this smaller class, as
it just wouldn't make sense. I figured that I could either declare the
smaller class inline in my larger class (not keen on doing that as it
makes a mess!) or give the smaller class private members and make the
larger class a friend so only it can use it.
Is this a good use of friend?
class (stored in a vector inside of the larger class). In a sense, it's
splitting functionality over two classes.
I don't want any other classes to be able to use this smaller class, as
it just wouldn't make sense. I figured that I could either declare the
smaller class inline in my larger class (not keen on doing that as it
makes a mess!) or give the smaller class private members and make the
larger class a friend so only it can use it.
Is this a good use of friend?