This code is most likely equal to this:
TimePoint now_ = TimePoint::min();
This means that min() is a static method, and calling it using an instance is similar to calling it, this instance is used only to determine the type. There was no black magic, these are just two syntaxes to do the same.
As for the compiled code: now_ already declared by the left side of the line, so when it is used for initialization on the right side, the compiler already knows its type and can call a static method. Attempting to call a non-static method should give an error (see @ BenVoigt comment below).
As the fact that you had to write this question showed that the syntax in the question is not the clearest. It can be tempting if the name is of type long and perhaps justified in declarations of member variables with an initializer (which is the question code). Inside the internal code functions, auto is the best way to reduce repetition.
hyde Dec 07 '16 at 13:45 2016-12-07 13:45
source share