This rule is Obsolete | |
Synopsis: | If an object is created using a default constructor, then don't use parenthesis in the declaration |
Language: | C++ |
Severity Level: | 3 |
Category: | Portability |
Description: |
Some compilers, like the Visual Studio compiler, don't care, but a declaration with parenthesis on the stack is not ANSI C++. // Incorrect!! void MyClass::F( int x) { OtherClass stackObj(); ... }; // Correct!! void MyClass::F( int x) { OtherClass stackObj; ... }; |