Let's say now i have a class named "app", if i want to invoke the default constructor, i would use app a; or if I want to omit the variable name, i can use app();. but if i use app a();, a compilation error occurs. can anyone explain why?
thanks.
I like explicitly writing it out so that there is absolutely no guessing which constructor is called.
I guess it's sort of like people that like to specify that they are using a function in the global namespace by using the :: prefix: ::abs(x); instead of abs(x);.
It's not required, but it makes things a little clearer when someone else is trying to read through what is going on.
Yeah, I'm not saying you can't use them. By the way I also use the '::' prefix, but mainly because MSVS then shows a list of the current functions, structures, typedefs and variables in the global namespace, and I just have to enter a part of the name and press Enter. A bit OffTopic, Sorry.