diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2581.md b/docs/error-messages/compiler-errors-2/compiler-error-c2581.md index c6e7b9a608..9097b0b6b3 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2581.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2581.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2581" title: "Compiler Error C2581" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2581" +ms.date: 11/04/2016 f1_keywords: ["C2581"] helpviewer_keywords: ["C2581"] -ms.assetid: 24a4e4c1-24d3-4e42-b760-7dcaf9740b16 --- # Compiler Error C2581 -'type' : static 'operator =' function is illegal +> 'type' : static 'operator =' function is illegal + +## Remarks The assignment (`=`) operator is incorrectly declared as **`static`**. Assignment operators cannot be **`static`**. For more information, see [User-Defined Operators (C++/CLI)](../../dotnet/user-defined-operators-cpp-cli.md). ## Example -The following sample generates C2581. +The following example generates C2581. ```cpp // C2581.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2582.md b/docs/error-messages/compiler-errors-2/compiler-error-c2582.md index 82484c7c1a..2a57df672e 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2582.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2582.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2582" title: "Compiler Error C2582" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2582" +ms.date: 11/04/2016 f1_keywords: ["C2582"] helpviewer_keywords: ["C2582"] -ms.assetid: ee1b9378-8bcd-4792-b87e-6d7a466d29ed --- # Compiler Error C2582 -'function' function is unavailable in 'type' +> 'function' function is unavailable in 'type' + +## Remarks An attempt was made to assign to an object that does not have an assignment operator. -The following sample generates C2582: +## Example + +The following example generates C2582: ```cpp // C2582.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2584.md b/docs/error-messages/compiler-errors-2/compiler-error-c2584.md index e63ec9e054..8164ce8b38 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2584.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2584.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2584" title: "Compiler Error C2584" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2584" +ms.date: 11/04/2016 f1_keywords: ["C2584"] helpviewer_keywords: ["C2584"] -ms.assetid: 836e2c0a-86c0-4742-b432-beb0191ad20e --- # Compiler Error C2584 -'Class' : direct base 'Base2' is inaccessible; already a base of 'Base1' +> 'Class' : direct base 'Base2' is inaccessible; already a base of 'Base1' + +## Remarks `Class` already derives directly from `Base1`. `Base2` also derives from `Base1`. `Class` cannot derive from `Base2` because that would mean inheriting (indirectly) from `Base1` again, which is not legal because `Base1` is already a direct base class. ## Example -The following sample generates C2584. +The following example generates C2584. ```cpp // C2584.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2585.md b/docs/error-messages/compiler-errors-2/compiler-error-c2585.md index 7ced014cea..32c34f271a 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2585.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2585.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2585" title: "Compiler Error C2585" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2585" +ms.date: 11/04/2016 f1_keywords: ["C2585"] helpviewer_keywords: ["C2585"] -ms.assetid: 05bb1a9c-28fb-4a88-a1b5-aea85ebdee1c --- # Compiler Error C2585 -explicit conversion to 'type' is ambiguous +> explicit conversion to 'type' is ambiguous + +## Remarks The type conversion can produce more than one result. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2586.md b/docs/error-messages/compiler-errors-2/compiler-error-c2586.md index a5767ea958..412a45f14d 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2586.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2586.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2586" title: "Compiler Error C2586" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2586" +ms.date: 11/04/2016 f1_keywords: ["C2586"] helpviewer_keywords: ["C2586"] -ms.assetid: dae703c7-5c38-4db6-8411-4d1b22713eb5 --- # Compiler Error C2586 -incorrect user-defined conversion syntax : illegal indirections +> incorrect user-defined conversion syntax : illegal indirections + +## Remarks Indirection of a conversion operator is not allowed. -The following sample generates C2586: +## Example + +The following example generates C2586: ```cpp // c2586.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2587.md b/docs/error-messages/compiler-errors-2/compiler-error-c2587.md index dd0b86bde4..f70167f35f 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2587.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2587.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2587" title: "Compiler Error C2587" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2587" +ms.date: 11/04/2016 f1_keywords: ["C2587"] helpviewer_keywords: ["C2587"] -ms.assetid: 7637a2c7-35d4-4b5a-a8f2-515a7bda98fd --- # Compiler Error C2587 -'identifier' : illegal use of local variable as default parameter +> 'identifier' : illegal use of local variable as default parameter + +## Remarks Local variables are not allowed as default parameters. -The following sample generates C2587: +## Example + +The following example generates C2587: ```cpp // C2587.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2588.md b/docs/error-messages/compiler-errors-2/compiler-error-c2588.md index 97560fa93c..774f364b96 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2588.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2588.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2588" title: "Compiler Error C2588" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2588" +ms.date: 11/04/2016 f1_keywords: ["C2588"] helpviewer_keywords: ["C2588"] -ms.assetid: 19a0cabd-ca13-44a5-9be3-ee676abf9bc4 --- # Compiler Error C2588 -'::~identifier' : illegal global destructor +> '::~identifier' : illegal global destructor + +## Remarks The destructor is defined for something other than a class, structure, or union. This is not allowed. This error can be caused by a missing class, structure, or union name on the left side of the scope resolution (`::`) operator. -The following sample generates C2588: +## Example + +The following example generates C2588: ```cpp // C2588.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2589.md b/docs/error-messages/compiler-errors-2/compiler-error-c2589.md index e712be3b26..3f7e4fa6da 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2589.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2589.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2589" title: "Compiler Error C2589" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2589" +ms.date: 11/04/2016 f1_keywords: ["C2589"] helpviewer_keywords: ["C2589"] -ms.assetid: 1d7942c7-8a81-4bb4-b272-76a0019e8513 --- # Compiler Error C2589 -'identifier' : illegal token on right side of '::' +> 'identifier' : illegal token on right side of '::' + +## Remarks If a class, structure, or union name appears to the left of the scope-resolution operator (double colons), the token on the right must be a class, structure, or union member. Otherwise, any global identifier can appear on the right. The scope-resolution operator cannot be overloaded. -The following sample generates C2589: +## Example + +The following example generates C2589: ```cpp // C2589.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2592.md b/docs/error-messages/compiler-errors-2/compiler-error-c2592.md index 637edee978..054f08281e 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2592.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2592.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2592" title: "Compiler Error C2592" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2592" +ms.date: 11/04/2016 f1_keywords: ["C2592"] helpviewer_keywords: ["C2592"] -ms.assetid: 833a4d7b-66ef-4d4c-ae83-a533c2b0eb07 --- # Compiler Error C2592 -'class': 'base_class_2' is inherited from 'base_class_1' and cannot be re-specified +> 'class': 'base_class_2' is inherited from 'base_class_1' and cannot be re-specified + +## Remarks You can only specify base classes that do not inherit from other base classes. In this case, only `base_class_1` is needed in the specification of **`class`** because `base_class_1` already inherits `base_class_2`. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2593.md b/docs/error-messages/compiler-errors-2/compiler-error-c2593.md index b12f1563fd..b31ff336de 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2593.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2593.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2593" title: "Compiler Error C2593" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2593" +ms.date: 11/04/2016 f1_keywords: ["C2593"] helpviewer_keywords: ["C2593"] -ms.assetid: 4a0fe9bb-2163-447d-91f6-1890ed8250f6 --- # Compiler Error C2593 -'operator identifier' is ambiguous +> 'operator identifier' is ambiguous + +## Remarks More than one possible operator is defined for an overloaded operator. This error may be fixed if you use an explicit cast on one or more actual parameters. -The following sample generates C2593: +## Examples + +The following example generates C2593: ```cpp // C2593.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2594.md b/docs/error-messages/compiler-errors-2/compiler-error-c2594.md index a68fd0ce54..c962231113 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2594.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2594.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2594" title: "Compiler Error C2594" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2594" +ms.date: 11/04/2016 f1_keywords: ["C2594"] helpviewer_keywords: ["C2594"] -ms.assetid: 68cd708f-266e-44b0-a211-3e3ab63b11bf --- # Compiler Error C2594 -'operator' : ambiguous conversions from 'type1' to 'type2' +> 'operator' : ambiguous conversions from 'type1' to 'type2' + +## Remarks No conversion from *type1* to *type2* was more direct than any other. We suggest two possible solutions to converting from *type1* to *type2*. The first option is to define a direct conversion from *type1* to *type2*, and the second option is to specify a sequence of conversions from *type1* to *type2*. -The following sample generates C2594. The suggested resolution to the error is a sequence of conversions: +## Example + +The following example generates C2594. The suggested resolution to the error is a sequence of conversions: ```cpp // C2594.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2597.md b/docs/error-messages/compiler-errors-2/compiler-error-c2597.md index 1c77cfc600..ed1bcf191c 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2597.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2597.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2597" title: "Compiler Error C2597" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2597" +ms.date: 11/04/2016 f1_keywords: ["C2597"] helpviewer_keywords: ["C2597"] -ms.assetid: 2e48127d-e3ff-4a40-8156-2863e45b1a38 --- # Compiler Error C2597 -illegal reference to non-static member 'identifier' +> illegal reference to non-static member 'identifier' + +## Remarks Possible causes: @@ -18,7 +19,9 @@ Possible causes: 1. A member access operator refers to a nonmember function. -1. The following sample generates C2597 and shows how to fix it: +## Example + +1. The following example generates C2597 and shows how to fix it: ```cpp // C2597.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2598.md b/docs/error-messages/compiler-errors-2/compiler-error-c2598.md index 017757d46f..9e996c4837 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2598.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2598.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2598" title: "Compiler Error C2598" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2598" +ms.date: 11/04/2016 f1_keywords: ["C2598"] helpviewer_keywords: ["C2598"] -ms.assetid: 40777c62-39ba-441e-b081-f49f94b43547 --- # Compiler Error C2598 -linkage specification must be at global scope +> linkage specification must be at global scope + +## Remarks The linkage specifier is declared at local scope. -The following sample generates C2598: +## Example + +The following example generates C2598: ```cpp // C2598.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2599.md b/docs/error-messages/compiler-errors-2/compiler-error-c2599.md index 4d8490f277..56a13a45ee 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2599.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2599.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2599" title: "Compiler Error C2599" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2599" +ms.date: 11/04/2016 f1_keywords: ["C2599"] helpviewer_keywords: ["C2599"] -ms.assetid: 88515f36-7589-47e2-862e-0de8b18d6668 --- # Compiler Error C2599 -'enum' : forward declaration of enum type is not allowed +> 'enum' : forward declaration of enum type is not allowed + +## Remarks The compiler no longer supports forward declaration of a managed enumeration. Forward declaration of an enum type is not allowed under [/Za](../../build/reference/za-ze-disable-language-extensions.md). -The following sample generates C2599: +## Example + +The following example generates C2599: ```cpp // C2599.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2600.md b/docs/error-messages/compiler-errors-2/compiler-error-c2600.md index 75038e37b8..63dcc2d64a 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2600.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2600.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2600" title: "Compiler Error C2600" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2600" +ms.date: 11/04/2016 f1_keywords: ["C2600"] helpviewer_keywords: ["C2600"] -ms.assetid: cce11943-ea01-4bee-a7b0-b67d24ec6493 --- # Compiler Error C2600 -'function' : cannot define a compiler-generated special member function (must be declared in the class first) +> 'function' : cannot define a compiler-generated special member function (must be declared in the class first) + +## Remarks Before member functions such as constructors or destructors can be defined for a class, they must be declared in the class. The compiler can generate default constructors and destructors (called special member functions) if none are declared in the class. However, if you define one of these functions without a matching declaration in the class, the compiler detects a conflict. To fix this error, in the class declaration, declare each member function that you define outside the class declaration. -The following sample generates C2600: +## Example + +The following example generates C2600: ```cpp // C2600.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2602.md b/docs/error-messages/compiler-errors-2/compiler-error-c2602.md index dabc0048be..bc32d316af 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2602.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2602.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2602" title: "Compiler Error C2602" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2602" +ms.date: 11/04/2016 f1_keywords: ["C2602"] helpviewer_keywords: ["C2602"] -ms.assetid: 6c07a40e-537e-4954-b5c5-1e0e58fe1952 --- # Compiler Error C2602 -'class::Identifier' is not a member of a base class of 'class' +> 'class::Identifier' is not a member of a base class of 'class' + +## Remarks `Identifier` cannot be accessed because it is not a member inherited from any base class. -The following sample generates C2602: +## Example + +The following example generates C2602: ```cpp // C2602.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2603.md b/docs/error-messages/compiler-errors-2/compiler-error-c2603.md index c66a5ff3e1..c4700923f0 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2603.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2603.md @@ -1,15 +1,16 @@ --- -description: "Learn more about: Compiler Error C2603" title: "Compiler Error C2603" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2603" +ms.date: 11/04/2016 f1_keywords: ["C2603"] helpviewer_keywords: ["C2603"] -ms.assetid: 9ca520d0-f082-4b65-933d-17c3bcf8b02c --- # Compiler Error C2603 > '*function*' : Too many block scope static objects with constructor/destructors in function +## Remarks + In versions of the Microsoft C++ compiler before Visual Studio 2015, or when the [/Zc:threadSafeInit-](../../build/reference/zc-threadsafeinit-thread-safe-local-static-initialization.md) compiler option is specified, there is a limit of 31 on the number of static objects you can have in an externally visible inline function. To resolve this issue, we recommend you adopt more recent version of the Microsoft C++ compiler toolset, or if possible, remove the /Zc:threadSafeInit- compiler option. If this is not possible, consider combining your static objects. If the objects are of the same type, consider use of a single static array of that type, and reference individual members as required. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c2605.md b/docs/error-messages/compiler-errors-2/compiler-error-c2605.md index a11f99a7a3..ee73a6aa64 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c2605.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c2605.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2605" title: "Compiler Error C2605" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2605" +ms.date: 11/04/2016 f1_keywords: ["C2605"] helpviewer_keywords: ["C2605"] -ms.assetid: a0e6f132-5acf-4e19-b277-ddf196d182bf --- # Compiler Error C2605 -'name' : this method is reserved within a managed or WinRT class +> 'name' : this method is reserved within a managed or WinRT class + +## Remarks Certain names are reserved by the compiler for internal functions. For more information, see [Destructors and finalizers](../../dotnet/how-to-define-and-consume-classes-and-structs-cpp-cli.md#BKMK_Destructors_and_finalizers). ## Example -The following sample generates C2605. +The following example generates C2605. ```cpp // C2605.cpp