Search code examples
c++syntaxinitialization-list

Braces After Initialization Lists


class Foo
{
    Foo(double InitValue): StoredDouble(InitValue)
    {
    }

    double StoredDouble;
}

Is there a syntax that will allow me to skip out on the curly braces after the initialization list? I know it's a minor thing, but I'd like to be as concise as possible in my code.


Solution

  • No, because Foo( double InitValue ) is actually a method and all methods must have opening and closing braces.