| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0eb057f commit cbf74cc
23 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,4 @@ | |||
| 1 | 1 | { | |
| 2 | - "files.associations": {} | ||
| 2 | + "files.associations": {}, | ||
| 3 | + "git.ignoreLimitWarning": true | ||
| 3 | 4 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,7 +82,7 @@ class CAdapt | |||
| 82 | 82 | ||
| 83 | 83 | The adapter class `CAdapt` is useful because some container-style classes expect to be able to obtain the addresses of their contained objects using the address-of operator. The redefinition of the address-of operator can confound this requirement, typically causing compilation errors and preventing the use of the non-adapted type with classes that expect it to "just work". `CAdapt` provides a way around those problems. | |
| 84 | 84 | ||
| 85 | - Typically, you will use `CAdapt` when you want to store `CComBSTR`, `CComPtr`, `CComQIPtr`, or `_com_ptr_t` objects in a container-style class. This was most commonly necessary for C++ Standard Library containers prior to support for the C++11 Standard, but C++11 Standard Library containers automatically work with types that have overloaded `operator&()`. The Standard Library achieves this by internally using [std::addressof()](http://msdn.microsoft.com/library/6243ddc8-486a-4961-8b0c-33e9dc2e0648) to get the true addresses of objects. | ||
| 85 | + Typically, you will use `CAdapt` when you want to store `CComBSTR`, `CComPtr`, `CComQIPtr`, or `_com_ptr_t` objects in a container-style class. This was most commonly necessary for C++ Standard Library containers prior to support for the C++11 Standard, but C++11 Standard Library containers automatically work with types that have overloaded `operator&()`. The Standard Library achieves this by internally using [std::addressof](../../standard-library/memory-functions.md#addressof) to get the true addresses of objects. | ||
| 86 | 86 | ||
| 87 | 87 | ## Requirements | |
| 88 | 88 | **Header:** atlcomcli.h | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -188,4 +188,4 @@ The minimum cost to Market 3 is: 17.29 | |||
| 188 | 188 | The function `FindMinToMkt` is written such that adding new factories does not require any code changes, just a recompilation. | |
| 189 | 189 | ||
| 190 | 190 | ## See Also | |
| 191 | - [C++ Abstract Declarators](http://msdn.microsoft.com/en-us/e7e18c18-0cad-4450-942b-d27e1d4dd088) | ||
| 191 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,9 +31,9 @@ translation.priority.ht: | |||
| 31 | 31 | - "zh-tw" | |
| 32 | 32 | --- | |
| 33 | 33 | # Declarations and Definitions (C++) | |
| 34 | - [Declarations](http://msdn.microsoft.com/en-us/2fd0cddb-b64c-4c9f-9aac-9f8e7ef892f4) introduce names in a program, for example the names of variables, namespaces, functions and classes. Declarations also specify type information as well as other characteristics of the object that is being declared. A name must be declared before it can be used; in C++ the point at which a name is declared determines whether it is visible to the compiler. You cannot refer to a function or class that is declared at some later point in the compilation unit; you can use *forward declarations* to get around this limitation. | ||
| 34 | + Declarations introduce names in a program, for example the names of variables, namespaces, functions and classes. Declarations also specify type information as well as other characteristics of the object that is being declared. A name must be declared before it can be used; in C++ the point at which a name is declared determines whether it is visible to the compiler. You cannot refer to a function or class that is declared at some later point in the compilation unit; you can use *forward declarations* to get around this limitation. | ||
| 35 | 35 | ||
| 36 | - [Definitions](http://msdn.microsoft.com/en-us/f96e2c0d-abb5-4414-9ea1-4d5b4048d50a) specify what code or data the name describes. The compiler needs the definition in order to allocate storage space for the thing that is being declared. | ||
| 36 | + Definitions specify what code or data the name describes. The compiler needs the definition in order to allocate storage space for the thing that is being declared. | ||
| 37 | 37 | ||
| 38 | 38 | ## Declarations | |
| 39 | 39 | A declaration introduces one or more names into a program. Declarations can occur more than once in a program. Therefore, classes, structures, enumerated types, and other user-defined types can be declared for each compilation unit. The constraint on this multiple declaration is that all declarations must be identical. Declarations also serve as definitions, except when the declaration: | |
@@ -81,7 +81,7 @@ char *strchr( const char *Str, const char Target ); | |||
| 81 | 81 | ||
| 82 | 82 | Declarations occur in a *scope*. The scope controls the visibility of the name declared and the duration of the object defined, if any. For more information about how scope rules interact with declarations, see [Scope](../cpp/scope-visual-cpp.md). | |
| 83 | 83 | ||
| 84 | - An object declaration is also a definition unless it contains the `extern` storage-class specifier described in [Storage-Class Specifiers](http://msdn.microsoft.com/en-us/10b3d22d-cb40-450b-994b-08cf9a211b6c). A function declaration is also a definition unless it is a prototype. A prototype is a function header without a defining function body. The definition of an object causes allocation of storage and appropriate initializations for that object. | ||
| 84 | + An object declaration is also a definition unless it contains the `extern` storage-class specifier described in [Storage classes](storage-classes-cpp.md). A function declaration is also a definition unless it is a prototype. A prototype is a function header without a defining function body. The definition of an object causes allocation of storage and appropriate initializations for that object. | ||
| 85 | 85 | ||
| 86 | 86 | ## Definitions | |
| 87 | 87 | A definition is a unique specification of an object or variable, function, class, or enumerator. Because definitions must be unique, a program can contain only one definition for a given program element. There can be a many-to-one correspondence between declarations and definitions. There are two cases in which a program element can be declared and not defined: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,4 +133,4 @@ print( d, 0 ); // Override default argument to achieve other | |||
| 133 | 133 | ``` | |
| 134 | 134 | ||
| 135 | 135 | ## See Also | |
| 136 | - [C++ Abstract Declarators](http://msdn.microsoft.com/en-us/e7e18c18-0cad-4450-942b-d27e1d4dd088) | ||
| 136 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -201,8 +201,6 @@ int main() | |||
| 201 | 201 | ||
| 202 | 202 | - The class has a default constructor (a constructor that can be called with no arguments). | |
| 203 | 203 | ||
| 204 | - Access control and ambiguity control are performed on `operator new` and on the constructors according to the rules set forth in [Ambiguity](http://msdn.microsoft.com/en-us/0b399cab-40a7-4e79-9278-05f40139a0e1) and [Initialization Using Special Member Functions](http://msdn.microsoft.com/en-us/82223d73-64cb-4923-b678-78f9568ff3ca). | ||
| 205 | - | ||
| 206 | 204 | No explicit per-element initialization can be done when allocating arrays using the **new** operator; only the default constructor, if present, is called. See [Default Arguments](../cpp/default-arguments.md) for more information. | |
| 207 | 205 | ||
| 208 | 206 | If the memory allocation fails (`operator new` returns a value of 0), no initialization is performed. This protects against attempts to initialize data that does not exist. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,6 @@ void __stdcall f3() throw(); | |||
| 61 | 61 | ||
| 62 | 62 | Using `void __declspec(nothrow) __stdcall f2();` has the advantage that you can use an API definition, such as that illustrated by the `#define` statement, to easily specify `nothrow` on a set of functions. The third declaration`, void __stdcall f3() throw();` is the syntax defined by the C++ standard. | |
| 63 | 63 | ||
| 64 | - See [Synchronous Exception Handling](http://msdn.microsoft.com/en-us/81595fae-d8ab-4c14-9670-8d6639cc0369) for more information. | ||
| 65 | 64 | ||
| 66 | 65 | **END Microsoft Specific** | |
| 67 | 66 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -158,8 +158,5 @@ if (num < 100) | |||
| 158 | 158 | ||
| 159 | 159 | ## See Also | |
| 160 | 160 | [Lexical Conventions](../cpp/lexical-conventions.md) | |
| 161 | - [C++ Integer Constants](http://msdn.microsoft.com/en-us/1f3b58a4-8346-4533-ba6e-df26d76f8dcf) | ||
| 162 | - [C++ Character Literals](http://msdn.microsoft.com/en-us/a7901c61-524d-47c6-beb6-d9dacc2e72ed) | ||
| 163 | - [C++ Floating-Point Constants](http://msdn.microsoft.com/en-us/f6273f24-a876-4484-a7a2-e82275692ad3) | ||
| 164 | 161 | [C++ String Literals](../cpp/string-and-character-literals-cpp.md) | |
| 165 | 162 | [C++ User-Defined Literals](../cpp/user-defined-literals-cpp.md) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -108,8 +108,6 @@ int i[2][2]; // two dimensional array | |||
| 108 | 108 | int f(int a, int b, int c); | |
| 109 | 109 | ``` | |
| 110 | 110 | ||
| 111 | - For information on argument lists, see [Function Declarations](http://msdn.microsoft.com/en-us/3f9b4e14-60d2-47c1-acd8-4fa8fc988be7). | ||
| 112 | - | ||
| 113 | 111 | Pointers and references to functions are declared by prepending the pointer or reference operator to the function name as shown below. Parentheses, normally optional, are required to distinguish a pointer to a function from a function that returns a pointer: | |
| 114 | 112 | ||
| 115 | 113 | ``` | |
@@ -163,7 +161,7 @@ PIFN pifnDispatchArray[7]; | |||
| 163 | 161 | int ( *pifnDispatchArray[7] )( char * ); | |
| 164 | 162 | ``` | |
| 165 | 163 | ||
| 166 | - For more information on typedef, see [typedef Specifier](http://msdn.microsoft.com/en-us/cc96cf26-ba93-4179-951e-695d1f5fdcf1). | ||
| 164 | + For more information on typedef, see [Aliases and typedefs](aliases-and-typedefs.md). | ||
| 167 | 165 | ||
| 168 | 166 | Pointers, references, arrays of a single base type can be combined in a single declaration (separated by commas) as | |
| 169 | 167 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ translation.priority.ht: | |||
| 33 | 33 | - "zh-tw" | |
| 34 | 34 | --- | |
| 35 | 35 | # Point of declaration in C++ | |
| 36 | - A name is considered to be declared immediately after its declarator but before its (optional) initializer. (For more information on declarators, see [Declarators](http://msdn.microsoft.com/en-us/8a7b9b51-92bd-4ac0-b3fe-0c4abe771838).) | ||
| 36 | + A name is considered to be declared immediately after its declarator but before its (optional) initializer. (For more information on declarators, see [Declarations and definitions](declarations-and-definitions.md).) | ||
| 37 | 37 | ||
| 38 | 38 | Consider this example: | |
| 39 | 39 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments