Search:

Type: Posts; User: laserlight

Search: Search took 0.33 seconds.

  1. Replies
    23
    Views
    2,233

    Dunno, I don't find that terribly interesting:...

    Dunno, I don't find that terribly interesting: when not using inheritance, you also just need to write the operator<< once. In my opinion, the main advantage of using a print member function is that...
  2. Replies
    23
    Views
    2,233

    That is fine because the overloaded operator

    That is fine because the overloaded operator<< cannot be a virtual member function, so making use of a virtual print function is normal. If you want, you can keep only the overloaded operator<< as...
  3. Replies
    23
    Views
    2,233

    If the iterator class is declared within the...

    If the iterator class is declared within the container class, then it would have access to the private members of the container class even without being declared a friend since a nested class is...
  4. Replies
    23
    Views
    2,233

    This observation does not show that "friends...

    This observation does not show that "friends actually support comparable or greater degrees of encapsulation than do member functions". Rather, it is a practical point concerning the tendency of...
  5. Replies
    23
    Views
    2,233

    No, I would argue that they do not support...

    No, I would argue that they do not support greater degrees of encapsulation than do member functions: the fact that they are not members is not relevant here, since either way "the smaller the number...
  6. Replies
    23
    Views
    2,233

    These articles concentrate more on membership...

    These articles concentrate more on membership than friendship, but they should also give you some insight on the topic:
    How Non-Member Functions Improve Encapsulation by Scott Meyers
    GotW #84:...
Results 1 to 6 of 6