diff --git a/docs/cpp-conformance-improvements-2017.md b/docs/cpp-conformance-improvements-2017.md index 98260448bf..7fa4793fbb 100644 --- a/docs/cpp-conformance-improvements-2017.md +++ b/docs/cpp-conformance-improvements-2017.md @@ -285,6 +285,13 @@ namespace } ``` +### Classes declared in anonymous namespaces +According to the C++ standard, a class declared inside an anonymous namespace has internal linkage, and therefore cannot be exported. In Visual Studio 2015 and earlier, this rule was not enforced. In Visual Studio 2017 the rule is partially enforced. The following example raises this error in Visual Studio 2017: "error C2201: 'const `anonymous namespace'::S1::`vftable'': must have external linkage in order to be exported/imported." + +```cpp +struct __declspec(dllexport) S1 { virtual void f() {} }; //C2201 +``` + ### Default initializers for value class members (C++/CLI) In Visual Studio 2015 and earlier, the compiler permitted (but ignored) a default member initializer for a member of a value class. Default initialization of a value class always zero-initializes the members; a default constructor is not permitted. In Visual Studio 2017, default member initializers raise a compiler error, as shown in this example: diff --git a/docs/cppcx/platform-box-class.md b/docs/cppcx/platform-box-class.md index 6dbca5f179..a927c5cc8e 100644 --- a/docs/cppcx/platform-box-class.md +++ b/docs/cppcx/platform-box-class.md @@ -32,10 +32,17 @@ ref class Box abstract; **Header:** vccorlib.h **Namespace:** Platform - -## Box::Box Constructor -Creates a `Box` that can encapsulate a value of the specified type. - +|Member|Description| +|------------|-----------------| +|[Box Constructor](#ctor)|Creates a `Box` that can encapsulate a value of the specified type.| +|[operator Box<const T>^](#box-const-t)|Enables boxing conversions from a `const` value class `T` or `enum` class `T` to `Box`.| +|[operator Box<const volatile T>^](#box-const-volatile-t)|Enables boxing conversions from a `const volatile` value class `T` or `enum` type `T` to `Box`. | +|[operator Box<T>^](#box-t)|Enables boxing conversions from a value class `T` to `Box`.| +|[operator Box<volatile T>^](#box-volatile-t)|Enables boxing conversions from a `volatile` value class `T` or `enum` type `T` to `Box`.| +|[Box::operator T](#t)|Enables boxing conversions from a value class `T` or `enum` class `T` to `Box`.| +## Box::Box Constructor +Creates a `Box` that can encapsulate a value of the specified type.| +|[Value property](#value)|Returns the value that is encapsulated in the `Box` object.| ### Syntax ```cpp @@ -47,7 +54,7 @@ Box(T valueArg); The type of value to be boxed—for example, `int`, `bool`, `float64`, `DateTime`. -## Box::operator Box<const T>^ Operator +## Box::operator Box<const T>^ Operator Enables boxing conversions from a `const` value class `T` or `enum` class `T` to `Box`. ### Syntax @@ -61,14 +68,9 @@ operator Box^(const T valueType); Any value class, value struct, or enum type. Includes the built-in types in the [default namespace](../cppcx/default-namespace.md). ### Return Value - A `Platform::Box``^` instance that represents the original value boxed in a ref class. + A `Platform::Box^` instance that represents the original value boxed in a ref class. - - - - ---- -## Box::operator Box<const volatile T>^ Operator +## Box::operator Box<const volatile T>^ Operator Enables boxing conversions from a `const volatile` value class `T` or `enum` type `T` to `Box`. ### Syntax @@ -82,14 +84,9 @@ operator Box^(const volatile T valueType); Any enum type, value class, or value struct. Includes the built-in types in the [default namespace](../cppcx/default-namespace.md). ### Return Value - A `Platform::Box``^` instance that represents the original value boxed in a ref class. + A `Platform::Box^` instance that represents the original value boxed in a ref class. - - - - ---- -## Box::operator Box<T>^ Operator +## Box::operator Box<T>^ Operator Enables boxing conversions from a value class `T` to `Box`. ### Syntax @@ -103,14 +100,9 @@ operator Box^(const T valueType); Any enum type, value class, or value struct. Includes the built-in types in the [default namespace](../cppcx/default-namespace.md). ### Return Value - A `Platform::Box``^` instance that represents the original value boxed in a ref class. + A `Platform::Box^` instance that represents the original value boxed in a ref class. - - - - ---- -## Box::operator Box<volatile T>^ Operator +## Box::operator Box<volatile T>^ Operator Enables boxing conversions from a `volatile` value class `T` or `enum` type `T` to `Box`. ### Syntax @@ -124,14 +116,9 @@ operator Box^(volatile T valueType); Any enum type, value class, or value struct. Includes the built-in types in the [default namespace](../cppcx/default-namespace.md). ### Return Value - A `Platform::Box``^` instance that represents the original value boxed in a ref class. + A `Platform::Box^` instance that represents the original value boxed in a ref class. - - - - ---- -## Box::operator T Operator +## Box::operator T Operator Enables boxing conversions from a value class `T` or `enum` class `T` to `Box`. ### Syntax @@ -145,14 +132,10 @@ operator Box^(T valueType); Any enum type, value class, or value struct. Includes the built-in types in the [default namespace](../cppcx/default-namespace.md). ### Return Value - A `Platform::Box``^` instance that represents the original value boxed in a ref class. + A `Platform::Box^` instance that represents the original value boxed in a ref class. - - - ---- -## Box::Value Property +## Box::Value Property Returns the value that is encapsulated in the `Box` object. ### Syntax diff --git a/docs/cppcx/platform-string-class.md b/docs/cppcx/platform-string-class.md index 1008b26c07..c7b4f7f2c9 100644 --- a/docs/cppcx/platform-string-class.md +++ b/docs/cppcx/platform-string-class.md @@ -73,7 +73,7 @@ public ref class String sealed : Object, **Properties** - The String class has the following properties. + The String class has the following operators. |Member|Description| |------------|-----------------|