Can we apply content not explicitly cited from the normative references to the C++ standard?

The function of the Normative References section of an ISO standard document is defined in ISO/IEC Directives, Part 2, 2011 §6.2.2: 6.2.2 Normative references This conditional element shall give a list of the referenced documents cited (see 6.6.7.5) in the document in such a way as to make them indispensable for the application of the … Read more

Should a collection of constants be placed in a class or interface?

If they have strong connections, then I’d put them in an enum: public enum Error { ERROR_1(“-1”, “foo went wrong”), ERROR_2(“-2”, “bar went wrong”); private final String id; private final String message; Error(String id, String message) { this.id=id; this.message=message; } public String getId() { return id; } public String getMessage() { return message; } } … Read more

Giving the script tag an ID

It’s fine in all current browsers. The only browser that got <script id> wrong was Netscape 4, which we stopped caring about a long, long time ago. That quirksmode page seems to be badly out of date, what with its use of language attributes, script <!– hiding, and application/x-javascript. Its advice about avoiding <script> in … Read more

Why both clang and gcc only give a warning when there is a space after backslash if C standard says that whitespace is forbidden?

The compiler is allowed to extend the language as long as the document the change which gcc does in their docs in section 6.21 Slightly Looser Rules for Escaped Newlines. Recently, the preprocessor has relaxed its treatment of escaped newlines. Previously, the newline had to immediately follow a backslash. The current implementation allows whitespace in … Read more