Class Order Style

Jolly James via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Feb 20 05:47:07 PST 2017


How to sort the members of a class?

like:
>1. properties
>then
>2. private 3. methods
>4. ctors
... and so on. are there any recommendations?


And what is better?

>class A
>{
>private:
>    int a;
>    int b;
>public:
>    int c;
>    int d;
>}
or
>class A
>{
>    private
>    {
>        int a;
>        int b;
>    }
>    public
>    {
>        int c;
>        int d;
>    }
>}


More information about the Digitalmars-d-learn mailing list