-
I actually agree with you in the other thread. The do...while(0) construct is nice in C when function-style macros are used, but in C++ you really shouldn't use it.
I still maintain that a class with all private members that just friends other classes (if it doesn't friend anything, it's useless anyway) should be converted as laserlight suggested.
-
I'm not sure if I understood how to implement it. But will surely give it a look. The issue of classes is still something I'm studying.
-
Like this:
Code:
class ptr_class_base
{
protected:
class use_count
{
public:
// members here
};
};
class ptr_class : private ptr_class_base
{
// use_count is visible and accessible here
};
// Now we suddenly need another class that needs to use use_count.
class another_ptr_class : private ptr_class_base
{
// use_count is visible here - and we didn't have to change it
};