Question: I came across a weird error with std::chrono,
If I do something like this:

```
TimeHandling time(std::chrono::milliseconds(1000 / 125));
time.start();

```

Everything is ok.
But if instead I put the milliseconds value in a variable:

```
int mpl = 1000 / 125;
TimeHandling time(std::chrono::milliseconds(mpl));
time.start();

```

g++ throw this error:

```
 request for member ‘start’ in ‘time’, which is of non-class type ‘TimeHandling(std::chrono::milliseconds) {aka TimeHandling(std::chrono::duration<long int, std::ratio<1l, 1000l> >)}’

```

Does someone know why ?

Answer: 
The second version declares a function with a parameter called `mpl`

See <http://en.wikipedia.org/wiki/Most_vexing_parse> and <https://stackoverflow.com/tags/most-vexing-parse/info>

C++11 allows you to use braces to disambiguate initializations from declarations:

```
TimeHandling time{std::chrono::milliseconds(mpl)};

```

or, using braces for both initializations:

```
TimeHandling time{std::chrono::milliseconds{mpl}};

```
This line 

```
TimeHandling time(std::chrono::milliseconds(mpl));

```

declares a function that returns a `TimeHandling` object, and take an `std::chrono::milliseconds` parameter named `mpl`.

When a compiler faces the dilemma of considering this kind of statement either as a function declaration or as a constructor call, it's forced (by the standard) to consider it as a function declaration.

Use brace initialization to correct this problem and disambiguate the statement.