Hello everyone) Recently I've had an argument with my calleague on how class members have to be organized - should I place them in multiple modifier sections according to their purpose or should I only keep single section for each access modifier - public, private, protected - and delimit them with line breaks? I do realize it is more like matter of taste, but we needed some objective judgements. Thanks))
It is a matter of taste. Generally there is a single section for each access modifier, delimited by line breaks and commented when nessesary. This is done for users of class, so they could know what thy can use (public section) with a single glance and won't have to look through whole class to see if they have missed something. Same for those who want to inherit from your class and protected section.
Of course this is not always possible, as member type aliases and nested classes have to appear before they can be used, so sometimes you will have to split one section in multiple ones no matter what.