language-lawyer
int a[] = {1,2,}; Why is a trailing comma in an initializer-list allowed?
Maybe I am not from this planet, but it would seem to me that the following should be a syntax error:[详细]
2023-03-28 06:05 分类:问答Ambiguous injected class name is not an 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:[详细]
2023-03-27 02:23 分类:问答Is &*p valid C, given that p is a pointer to an incomplete type?
Is the following example a valid complete translation unit in C? struct foo; struct foo *bar(struct foo *j)[详细]
2023-03-24 23:12 分类:问答Do we really need "enum class" in C++11?
When we have, struct E { enum E_ { HELLO }; }; // \'E\' is inheritable then why do we need, enum class E { HELLO };// \'E\' is not inheritable[详细]
2023-03-24 22:32 分类:问答Ordering of using namespace std; and includes?
I recently saw this code being used in a source file in a C++ project: using namespace std; #include <iostream>[详细]
2023-03-23 17:53 分类:问答Is it still safe to delete nullptr in c++0x?
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:[详细]
2023-03-21 14:12 分类:问答Confusing language in specification of strtol, et al
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:[详细]
2023-03-20 05:50 分类:问答Why base class is not automatically deduced in the same "auto" declaration?
Below error related to auto, is understandable: auto i = int(), d = double(); // error: inconsistent deduction for ‘auto’[详细]
2023-03-17 06:57 分类:问答Does C# need the private keyword?
(inspired by this comment) Is there ever a situation in which you need to use开发者_JAVA技巧 the private keyword?[详细]
2023-03-13 04:27 分类:问答Why static method overrides base class non-static method?
struct B { void foo () {} }; struct D : B { using B::foo; static void foo () {} }; int main () { D obj; obj.foo();// calls D::foo() !?[详细]
2023-03-13 03:55 分类:问答