Maybe I am not from this planet, but it would seem to me that the following should be a syntax error:
What I read in the C++ standard about injected class names contradicts (as I see it) with the behavior of a sample program I will present shortly. Here\'s what I read:
Is the following example a valid complete translation unit in C? struct foo; struct foo *bar(struct foo *j)
When we have, struct E { enum E_ { HELLO }; }; // \'E\' is inheritable then why do we need, enum class E { HELLO };// \'E\' is not inheritable
I recently saw this code being used in a source file in a C++ project: using namespace std; #include <iostream>
In c++03 it is pretty clear that deleting a null pointer has no effect. Indeed, it is explicitly stated in §5.3.5/2 that:
The specification for strtol conceptually divides the input string into \"initial whitespace\", a \"subject sequence\", and a \"final string\", and defines the \"subject sequence\" as:
Below error related to auto, is understandable: auto i = int(), d = double(); // error: inconsistent deduction for ‘auto’
(inspired by this comment) Is there ever a situation in which you need to use开发者_JAVA技巧 the private keyword?
struct B { void foo () {} }; struct D : B { using B::foo; static void foo () {} }; int main () { D obj; obj.foo();// calls D::foo() !?