language-lawyer
Why is "using namespace X;" not allowed at class/struct level?
class C { using namespace std;// error }; namespace N { using namespace std; // ok } int main () { using namespace std; // ok[详细]
2023-03-12 04:47 分类:问答string::insert at end of string
The following two lines do the same thing in Visual Studio 2005: 开发者_如何学Go myString.insert(myString.size(),1,myNewChar);[详细]
2023-03-11 19:15 分类:问答Why isn't there any compiler error when a return statement is not present?
Unlike Java, in C/C++ the following is allowed: int* foo () { if(x) return p; // What if control reaches here?[详细]
2023-03-11 09:03 分类:问答Are uninitialized pointers in objects with static storage duration initialized to NULL, or to all-zeros?
out of curiousity and because I don\'t have my copy of the standard at hand right now: Given an implementation where null pointers are not represented by an all-zeros pattern, will uninitialized poin[详细]
2023-03-10 23:08 分类:问答Why virtual function can't be unimplemented when allocated with 'new'?
struct A { virtual void foo();// unused and unimplemented virtual void bar () {} }; int main () { A obj;// ok[详细]
2023-03-10 10:57 分类:问答Is it undefined behaviour to delete a null void* pointer?
I know that deleteing a null pointer is a no-op: In either alternative, if the value of the operand of delete is the null pointer the operation has no effect.[详细]
2023-03-09 17:01 分类:问答Is this example causing an undefined behaviour? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: Undefined Behavior and Sequence Points[详细]
2023-03-08 07:02 分类:问答Why was std::swap moved to <utility>?
Why has std::swap been moved to the <utility> header for C++11? N3290 C.2.7 says: 17.6.3.2 Effect on original feature: Function swap moved to a different header[详细]
2023-03-07 07:45 分类:问答What is default destructor if a class inherits from a pure base class?
Considering next two classes : struct Base { virtual ~Base() { } virtual void foo() = 0; }; struct Derived : public Base[详细]
2023-02-27 04:45 分类:问答What are Gecko's Javascript interpreter engine semantics?
Edit In consideration of the answer response below regarding the reference ECMAScript Language Specification - 11.13.2 Compound Assignment[详细]
2023-02-25 20:28 分类:问答