tmp/tmpnwwa3udv/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## C++and ISO C++11 <a id="diff.cpp11">[[diff.cpp11]]</a>
|
| 2 |
+
|
| 3 |
+
This subclause lists the differences between C++and ISO C++11(ISO/IEC
|
| 4 |
+
14882:2011, *Programming Languages — C++*), by the chapters of this
|
| 5 |
+
document.
|
| 6 |
+
|
| 7 |
+
### Clause [[lex]]: lexical conventions <a id="diff.cpp11.lex">[[diff.cpp11.lex]]</a>
|
| 8 |
+
|
| 9 |
+
[[lex.ppnumber]] **Change:** *pp-number* can contain one or more single
|
| 10 |
+
quotes. **Rationale:** Necessary to enable single quotes as digit
|
| 11 |
+
separators. **Effect on original feature:** Valid C++11code may fail to
|
| 12 |
+
compile or may change meaning in this International Standard. For
|
| 13 |
+
example, the following code is valid both in C++11and in this
|
| 14 |
+
International Standard, but the macro invocation produces different
|
| 15 |
+
outcomes because the single quotes delimit a character literal in C++11,
|
| 16 |
+
whereas they are digit separators in this International Standard:
|
| 17 |
+
|
| 18 |
+
``` cpp
|
| 19 |
+
#define M(x, ...) __VA_ARGS__
|
| 20 |
+
int x[2] = { M(1'2,3'4) };
|
| 21 |
+
// int x[2] = {\ \ \ \ \ } --- C++11
|
| 22 |
+
// int x[2] = { 3'4 } --- this International Standard
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
### Clause [[basic]]: basic concepts <a id="diff.cpp11.basic">[[diff.cpp11.basic]]</a>
|
| 26 |
+
|
| 27 |
+
[[basic.stc.dynamic.deallocation]] **Change:** New usual (non-placement)
|
| 28 |
+
deallocator **Rationale:** Required for sized deallocation. **Effect on
|
| 29 |
+
original feature:** Valid C++11code could declare a global placement
|
| 30 |
+
allocation function and deallocation function as follows:
|
| 31 |
+
|
| 32 |
+
``` cpp
|
| 33 |
+
void operator new(std::size_t, std::size_t);
|
| 34 |
+
void operator delete(void*, std::size_t) noexcept;
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
In this International Standard, however, the declaration of
|
| 38 |
+
`operator delete` might match a predefined usual (non-placement)
|
| 39 |
+
`operator delete` ([[basic.stc.dynamic]]). If so, the program is
|
| 40 |
+
ill-formed, as it was for class member allocation functions and
|
| 41 |
+
deallocation functions ([[expr.new]]).
|
| 42 |
+
|
| 43 |
+
### Clause [[dcl.dcl]]: declarations <a id="diff.cpp11.dcl.dcl">[[diff.cpp11.dcl.dcl]]</a>
|
| 44 |
+
|
| 45 |
+
[[dcl.constexpr]] **Change:** `constexpr` non-static member functions
|
| 46 |
+
are not implicitly `const` member functions. **Rationale:** Necessary to
|
| 47 |
+
allow `constexpr` member functions to mutate the object. **Effect on
|
| 48 |
+
original feature:** Valid C++11code may fail to compile in this
|
| 49 |
+
International Standard. For example, the following code is valid in
|
| 50 |
+
C++11 but invalid in this International Standard because it declares the
|
| 51 |
+
same member function twice with different return types:
|
| 52 |
+
|
| 53 |
+
``` cpp
|
| 54 |
+
struct S {
|
| 55 |
+
constexpr const int &f();
|
| 56 |
+
int &f();
|
| 57 |
+
};
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
### Clause [[input.output]]: input/output library <a id="diff.cpp11.input.output">[[diff.cpp11.input.output]]</a>
|
| 61 |
+
|
| 62 |
+
[[c.files]] **Change:** `gets` is not defined. **Rationale:** Use of
|
| 63 |
+
`gets` is considered dangerous. **Effect on original feature:** Valid
|
| 64 |
+
C++11code that uses the `gets` function may fail to compile in this
|
| 65 |
+
International Standard.
|
| 66 |
+
|