class members declaration order

Programming taught me focusing on differences. When reading others code, my eyes scanning; name of namespaces, classes, class members, function arguments, use of white spaces, format of the code, overloaded operators, choose of data structures, use of algorithms, what they hand-rolled and what dependencies they use, build scripts, physical layout of the project… you name it. Trying to rationale why the things are the way they are. My style is constantly evolving with everything I read, watch and experiment.

Here is how I layout members of a class:

class name { 
public:
// type aliases

private:
// private member variables

public:
// special member functions

// public member functions

private:
// private member functions

public:
// overloaded operators

// static member functions/variables

// friend functions
// friend classes
};

// non-member operator overloads

// free functions

Not claiming it’s the best way or something. I feel like I’m still having blunder years of my programming journey, maybe that’s a phase :) but I’m in this stop now. Thanks for reading…