Is Line1 initializing date member data?
This, of course, is the same as the definition of the definition of an object. Note that this can only be done in one translation unit, so if the class definition is in the header file, then it must be in the source file.
Is Line1 the only way to initialize a data item that is not an integral constant?
In C ++ 03 it was. In C ++ 11, any static member of type const
literal can have an initializer in the class definition. You still need a member definition if it is "used by odr" (roughly speaking, if you are doing something that requires its address, not just its value). In this case, the definition should again be in one translation unit and should not have an initializer (since the class definition is no longer in place).
Mike seymour
source share