Mixing in-class initialization and initializer lists From this question, I do know that initialization list and in-class initialization are different things.

The class in the following code has members with in-class initializers and those initialized in initialization list in constructors:

class Bamboo {
public:
    int a = {0};
    int b;

    Bamboo() :a(3), b(12) {
        std::cout &lt;&lt; a &lt;&lt; ", " &lt;&lt; b;
    }
};

int main() {
    Bamboo spikey; // outputs "3, 12"
}


This code compiles, but is it okay? Is it bad practice?

The only reason I am not using the initialization list for all members is that in the class I have many other members which are never initialized by constructor arguments. Plus, it's tedious to write the entire initialization list out in the constructor:

class Bamboo {
public:
    int a;
    std::string str;
    bool b;

    int c = {1}, d = {2}, e = {3}, f = {4}, g = {5};

    // each of c, d, e, f and g is always initialized to the same values regardless of which constructor is called
    Bamboo(bool cb)                           :a(1),  str("hello"), b(cb)    {}
    Bamboo(std::string cstr, int ca)          :a(ca), str(cstr),    b(false) {}
    Bamboo(int ca, bool cb, std::string cstr) :a(ca), str(cstr),    b(cb)    {}
}
Well, the first example is bad for a simple reason: It contains code which is never used, as none of the in-class-initializers are used by any constructor.

The second one is fine, using in-class-initializers for any initializations multiple constructors share (you don't even have to decide between multiple choices).
One can argue about extracting the constant initializers for the other three members out of the single constructor having one for each respective one, but that's debatable.

There's only one more criticism of your code:
The last single-line-comment is too long, you should have split it.