Quantcast
Channel: User Marco A. - Stack Overflow
Viewing all articles
Browse latest Browse all 45

Most vexing parse confusion

$
0
0

I'm studying C++11 and I stumbled upon uniform initializers.

I don't understand the following code which should show the "most vexing parse" ambiguity:

#include<iostream>class Timer{public:    Timer() {}};int main() {    auto dv = Timer(); // What is Timer() ? And what type is dv?    int time_keeper(Timer()); // This is a function right? And why isn't the argument " Timer (*) ()" ?    return 0;}

Viewing all articles
Browse latest Browse all 45

Trending Articles