diff --git a/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md b/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md index 40f08d6fc1d..5b02d58d9d7 100644 --- a/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md +++ b/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md @@ -1,39 +1,38 @@ --- description: "Learn more about: How to: Modify the Target Framework and Platform Toolset" title: "How to: Modify the Target Framework and Platform Toolset" -ms.custom: "conceptual" -ms.date: "07/24/2019" +ms.custom: "contperf-fy21q3" +ms.date: 03/31/2021 helpviewer_keywords: ["msbuild (c++), howto: modify target framework and platform toolset"] -ms.assetid: 031b1d54-e6e1-4da7-9868-3e75a87d9ffe --- # How to: Modify the Target Framework and Platform Toolset -You can edit a Visual Studio C++ project file to target different versions of the C++ platform toolset, the Windows SDK and the .NET Framework (C++/CLI projects only). By default, the project system uses the .NET Framework version and the toolset version that correspond to the version of Visual Studio that you use to create the project. You can modify all these values in the .vcxproj file so that you can use the same code base for every compilation target. +You can edit a Visual Studio C++ project file to target different versions of the C++ platform toolset. The Windows SDK and the .NET Framework used are also editable. (The .NET Framework applies to C++/CLI projects only). A new project uses the default .NET Framework and toolset of the Visual Studio version that you use to create the project. If you modify these values in the .vcxproj file, you can use the same code base for every compilation target. ## Platform toolset -The platform toolset consists of the C++ compiler (cl.exe) and linker (link.exe), along with the C/C++ standard libraries. Since Visual Studio 2015, the major version of the toolset has remained at 14, which means that projects compiled with Visual Studio 2019 or Visual Studio 2017 are ABI-backwards-compatible with projects compiled with Visual Studio 2015. The minor version has updated by 1 for each version since Visual Studio 2015: +The platform toolset consists of the C++ compiler (cl.exe) and linker (link.exe), along with the C/C++ standard libraries. Visual Studio 2015, Visual Studio 2017, and Visual Studio 2019 are binary-compatible. It's shown by the major version of the toolset, which has remained at 14. Projects compiled in Visual Studio 2019 or Visual Studio 2017 are ABI-backwards-compatible with 2017 and 2015 projects. The minor version has updated by 1 for each version since Visual Studio 2015: - Visual Studio 2015: v140 - Visual Studio 2017: v141 - Visual Studio 2019: v142 -These toolsets support .NET Framework 4.5 and later. +These toolsets support the .NET Framework 4.5 and later. -Visual Studio also supports multitargeting for C++ projects. You can use the Visual Studio IDE to edit and build projects that were created with older versions of Visual Studio, without upgrading them to use a new version of the toolset. You do need to have the older toolsets installed on your computer. For more information, see [How to use native multi-targeting in Visual Studio](../porting/use-native-multi-targeting.md). For example, in Visual Studio 2015, you can *target* .NET Framework 2.0 but you must use an earlier toolset that supports it. +Visual Studio also supports multitargeting for C++ projects. You can use the latest Visual Studio IDE to edit and build projects created by older versions of Visual Studio. It doesn't require a project upgrade the projects to use a new version of the toolset. It does require the older toolset is installed on your computer. For more information, see [How to use native multi-targeting in Visual Studio](../porting/use-native-multi-targeting.md). For example, in Visual Studio 2015, you can *target* .NET Framework 2.0, but you must use an earlier toolset that supports it. ## Target framework (C++/CLI project only) -When you change the target Framework, also change the platform toolset to a version that supports that Framework. For example, to target the .NET Framework 4.5, you must use a compatible platform toolset such as Visual Studio 2015 (v140), Visual Studio 2013 (v120) or Visual Studio 2012 (v110). You can use the [Windows 7.1 SDK](https://www.microsoft.com/download/details.aspx?id=8279) platform toolset to target the .NET Framework 2.0, 3.0, 3.5, and 4, and the x86/x64 platforms. +When you change the target Framework, also change the platform toolset to a version that supports that Framework. For example, to target the .NET Framework 4.5, you must use a compatible platform toolset. These toolsets include Visual Studio 2015 (v140), Visual Studio 2013 (v120), or Visual Studio 2012 (v110). You can use the [Windows 7.1 SDK](https://www.microsoft.com/download/details.aspx?id=8279) to target .NET Framework 2.0, 3.0, 3.5, and 4. You can extend the target platform further by creating a custom platform toolset. For more information, see [C++ Native Multi-Targeting](https://devblogs.microsoft.com/cppblog/c-native-multi-targeting/) on the Visual C++ blog. ### To change the target Framework -1. In Visual Studio, in **Solution Explorer**, select your project. On the menu bar, open the **Project** menu and choose **Unload project**. This unloads the project (.vcxproj) file for your project. +1. In Visual Studio, in **Solution Explorer**, select your project. On the menu bar, open the **Project** menu and choose **Unload project**. This command unloads the project (.vcxproj) file for your project. > [!NOTE] - > A C++ project cannot be loaded while the project file is being modified in Visual Studio. However, you can use another editor such as Notepad to modify the project file while the project is loaded in Visual Studio. Visual Studio will detect that the project file has changed and prompt you to reload the project. + > A C++ project can't be loaded while you edit the project file in Visual Studio. However, you can use another editor such as Notepad to modify the project file while the project is loaded in Visual Studio. Visual Studio will detect that the project file has changed and prompt you to reload the project. 1. On the menu bar, select **File**, **Open**, **File**. In the **Open File** dialog box, navigate to your project folder, and then open the project (.vcxproj) file. @@ -45,19 +44,23 @@ You can extend the target platform further by creating a custom platform toolset 1. In **Solution Explorer**, open the shortcut menu for your project and then choose **Reload Project**. -1. To verify the change, in **Solution Explorer**, right-click to open the shortcut menu for your project (not for your solution) and then choose **Properties** to open your project **Property Pages** dialog box. In the left pane of the dialog box, expand **Configuration Properties** and then select **General**. Verify that **.NET Target Framework Version** shows the new Framework version. +1. To verify the change, on the menu bar, select **Project** > **Properties** to open your project **Property Pages** dialog box. In the dialog box, select the **Configuration Properties** > **General** property page. Verify that **.NET Target Framework Version** shows the new Framework version. ### To change the platform toolset -1. In Visual Studio, in **Solution Explorer**, open the shortcut menu for your project (not for your solution) and then choose **Properties** to open your project **Property Pages** dialog box. +1. In Visual Studio, on the menu bar, select **Project** > **Properties** to open your project **Property Pages** dialog box. -1. In the **Property Pages** dialog box, open the **Configuration** drop-down list and then select **All Configurations**. +1. In the top of the **Property Pages** dialog box, open the **Configuration** drop-down list and then select **All Configurations**. -1. In the left pane of the dialog box, expand **Configuration Properties** and then select **General**. +1. In the dialog box, select the **Configuration Properties** > **General** property page. -1. In the right pane, select **Platform Toolset** and then select the toolset you want from the drop-down list. For example, if you have installed the Visual Studio 2010 toolset, select **Visual Studio 2010 (v100)** to use it for your project. +1. In the properties page, select **Platform Toolset** and then select the toolset you want from the drop-down list. For example, if you've installed the Visual Studio 2010 toolset, select **Visual Studio 2010 (v100)** to use it for your project. -1. Choose the **OK** button. +1. Choose the **OK** button to save your changes. + +## Next Steps + +[Walkthrough: Working with Projects and Solutions (C++)](../ide/walkthrough-working-with-projects-and-solutions-cpp.md) ## See also diff --git a/docs/build/integrate-vcpkg.md b/docs/build/integrate-vcpkg.md index 33f5b1161e1..22d394f8b3e 100644 --- a/docs/build/integrate-vcpkg.md +++ b/docs/build/integrate-vcpkg.md @@ -47,5 +47,5 @@ If you've used the **`integrate`** option, you should remove the integration bef [Install vcpkg](install-vcpkg.md)\ [Manage libraries with vcpkg](manage-libraries-with-vcpkg.md)\ [vcpkg command-line reference](vcpkg-command-line-reference.md)\ -[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\ +[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\ [Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md) diff --git a/docs/build/manage-libraries-with-vcpkg.md b/docs/build/manage-libraries-with-vcpkg.md index 48a0e8548aa..e162f90139d 100644 --- a/docs/build/manage-libraries-with-vcpkg.md +++ b/docs/build/manage-libraries-with-vcpkg.md @@ -319,6 +319,6 @@ Type **`vcpkg remove`** to remove an installed library. If any other libraries d [Install vcpkg](install-vcpkg.md)\ [Integrate vcpkg](integrate-vcpkg.md)\ [vcpkg command-line reference](vcpkg-command-line-reference.md)\ -[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\ +[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\ [Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md)\ [Installing and Using Packages Example: SQLite](https://github.com/microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md) diff --git a/docs/build/vcpkg-command-line-reference.md b/docs/build/vcpkg-command-line-reference.md index dfceb2b124b..05183d0b457 100644 --- a/docs/build/vcpkg-command-line-reference.md +++ b/docs/build/vcpkg-command-line-reference.md @@ -45,5 +45,5 @@ A quick reference to the commands available in vcpkg. [Install vcpkg](install-vcpkg.md)\ [Integrate vcpkg](integrate-vcpkg.md)\ [Manage libraries with vcpkg](manage-libraries-with-vcpkg.md)\ -[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\ +[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\ [Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md) diff --git a/docs/build/vcpkg.md b/docs/build/vcpkg.md index bf3bd28ad9e..fb4ae32fda3 100644 --- a/docs/build/vcpkg.md +++ b/docs/build/vcpkg.md @@ -57,5 +57,5 @@ Use the **`vcpkg contact --survey`** command to send feedback to Microsoft about [Integrate vcpkg](integrate-vcpkg.md)\ [Manage libraries with vcpkg](manage-libraries-with-vcpkg.md)\ [vcpkg command-line reference](vcpkg-command-line-reference.md)\ -[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\ +[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\ [Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md) diff --git a/docs/c-runtime-library/reference/ceil-ceilf-ceill.md b/docs/c-runtime-library/reference/ceil-ceilf-ceill.md index 7f0c769d08b..abab0ce80e0 100644 --- a/docs/c-runtime-library/reference/ceil-ceilf-ceill.md +++ b/docs/c-runtime-library/reference/ceil-ceilf-ceill.md @@ -62,8 +62,8 @@ By default, this function's global state is scoped to the application. To change |Routine|Required header| |-------------|---------------------| -|**ceil**, **ceilf**, **ceill**|\| -|**ceil** macro | \ || +| **ceil**, **ceilf**, **ceill**| \ | +| **ceil** macro | \ | For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md). diff --git a/docs/c-runtime-library/reference/floor-floorf-floorl.md b/docs/c-runtime-library/reference/floor-floorf-floorl.md index c7241b1add4..2f05bbc33fa 100644 --- a/docs/c-runtime-library/reference/floor-floorf-floorl.md +++ b/docs/c-runtime-library/reference/floor-floorf-floorl.md @@ -63,7 +63,7 @@ By default, this function's global state is scoped to the application. To change |Function|Required header| |--------------|---------------------| |**floor**, **floorf**, **floorl**|\| -|**floor** macro | \ || +|**floor** macro | \ | For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md). diff --git a/docs/c-runtime-library/reference/fmin-fminf-fminl.md b/docs/c-runtime-library/reference/fmin-fminf-fminl.md index 326ac59084a..1d7c0035e17 100644 --- a/docs/c-runtime-library/reference/fmin-fminf-fminl.md +++ b/docs/c-runtime-library/reference/fmin-fminf-fminl.md @@ -76,7 +76,7 @@ If you use the \ `fmin()` macro, the type of the argument determines w |Routine|Required header| |-------------|---------------------| |**fmin**, **fminf**, **fminl**|C: \
C++: \ or \| -|**fmin** macro | \ || +|**fmin** macro | \ | For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md). diff --git a/docs/c-runtime-library/reference/lround-lroundf-lroundl-llround-llroundf-llroundl.md b/docs/c-runtime-library/reference/lround-lroundf-lroundl-llround-llroundf-llroundl.md index 3c38822cf9b..ceea5dedfed 100644 --- a/docs/c-runtime-library/reference/lround-lroundf-lroundl-llround-llroundf-llroundl.md +++ b/docs/c-runtime-library/reference/lround-lroundf-lroundl-llround-llroundf-llroundl.md @@ -76,7 +76,7 @@ By default, this function's global state is scoped to the application. To change |Routine|Required header| |-------------|---------------------| |**lround**, **lroundf**, **lroundl**, **llround**, **llroundf**, **llroundl**|\| -|**lround** macro | \ || +|**lround** macro | \ | For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md). diff --git a/docs/c-runtime-library/reference/round-roundf-roundl.md b/docs/c-runtime-library/reference/round-roundf-roundl.md index c9aed4a9bd4..22c9b0c3cb6 100644 --- a/docs/c-runtime-library/reference/round-roundf-roundl.md +++ b/docs/c-runtime-library/reference/round-roundf-roundl.md @@ -61,7 +61,7 @@ By default, this function's global state is scoped to the application. To change |Routine|Required header| |-------------|---------------------| |**round**, **roundf**, **roundl**|\| -|**round** macro | \ || +|**round** macro | \ | For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md). diff --git a/docs/c-runtime-library/reference/stat-functions.md b/docs/c-runtime-library/reference/stat-functions.md index 85720c767d0..9902a3527f6 100644 --- a/docs/c-runtime-library/reference/stat-functions.md +++ b/docs/c-runtime-library/reference/stat-functions.md @@ -125,7 +125,7 @@ By default, this function's global state is scoped to the application. To change The **_stat** structure, defined in SYS\STAT.H, includes the following fields. -|Field|| +|Field|Description| |-|-| | **st_gid** | Numeric identifier of group that owns the file (UNIX-specific) This field will always be zero on Windows systems. A redirected file is classified as a Windows file. | | **st_atime** | Time of last access of file. Valid on NTFS but not on FAT formatted disk drives. | diff --git a/docs/c-runtime-library/reference/umask-s.md b/docs/c-runtime-library/reference/umask-s.md index 908619144cb..3f00a2026f7 100644 --- a/docs/c-runtime-library/reference/umask-s.md +++ b/docs/c-runtime-library/reference/umask-s.md @@ -50,7 +50,7 @@ The **_umask_s** function sets the file-permission mask of the current process t The integer expression *pmode* contains one or both of the following manifest constants, defined in SYS\STAT.H: -|*pmode*|| +|*pmode*|Description| |-|-| |**_S_IWRITE**|Writing permitted.| |**_S_IREAD**|Reading permitted.| diff --git a/docs/c-runtime-library/reference/umask.md b/docs/c-runtime-library/reference/umask.md index c721f27f82d..cb9daca7468 100644 --- a/docs/c-runtime-library/reference/umask.md +++ b/docs/c-runtime-library/reference/umask.md @@ -35,7 +35,7 @@ The **_umask** function sets the file-permission mask of the current process to The integer expression *pmode* contains one or both of the following manifest constants, defined in SYS\STAT.H: -|*pmode*| | +|*pmode*|Description| |-|-| | **_S_IWRITE** | Writing permitted. | | **_S_IREAD** | Reading permitted. | diff --git a/docs/c-runtime-library/reference/utime-utime32-utime64-wutime-wutime32-wutime64.md b/docs/c-runtime-library/reference/utime-utime32-utime64-wutime-wutime32-wutime64.md index 62fea5f70a5..ed2a5e043e8 100644 --- a/docs/c-runtime-library/reference/utime-utime32-utime64-wutime-wutime32-wutime64.md +++ b/docs/c-runtime-library/reference/utime-utime32-utime64-wutime-wutime32-wutime64.md @@ -72,7 +72,7 @@ The **_utime** function sets the modification time for the file specified by *fi The **_utimbuf** structure stores file access and modification times used by **_utime** to change file-modification dates. The structure has the following fields, which are both of type **time_t**: -| Field | | +| Field | Description | |-------|---| | **actime** | Time of file access | | **modtime** | Time of file modification | diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2276.md b/docs/error-messages/compiler-errors-1/compiler-error-c2276.md index 2f3902f06c0..b6fe542bb7f 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2276.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2276.md @@ -1,18 +1,23 @@ --- description: "Learn more about: Compiler Error C2276" title: "Compiler Error C2276" -ms.date: "11/04/2016" +ms.date: 03/25/2021 f1_keywords: ["C2276"] helpviewer_keywords: ["C2276"] -ms.assetid: 62005ad9-6cb9-4b1f-965d-b875adaf695e --- # Compiler Error C2276 -'operator' : illegal operation on bound member function expression +> '*operator*' : illegal operation on bound member function expression -The compiler found a problem with the syntax to create a pointer-to-member. +The compiler found a problem with the syntax used to create a pointer-to-member. -The following sample generates C2276: +## Remarks + +Error `C2276` is often caused when you attempt to create a pointer-to-member by using an instance variable to qualify the member, instead of a class type. You may also see this error if you're trying to call a member function by using the wrong syntax. + +## Example + +This sample shows several ways C2276 may occur, and how to fix them: ```cpp // C2276.cpp @@ -22,22 +27,24 @@ public: } a; int (*pf)() = &a.func; // C2276 -// try the following line instead -// int (A::*pf3)() = &A::func; +// pf isn't qualified by the class type, and it +// tries to take a member address from an instance of A. +// Try the following line instead: +// int (A::*pf)() = &A::func; -class B { +class B : public A { public: void mf() { - &this -> mf; // C2276 + auto x = &this -> func; // C2276 // try the following line instead - // &B::mf; + // auto x = &B::func; } }; int main() { - A a; - &a.func; // C2276 + A a3; + auto pmf1 = &a3.func; // C2276 // try the following line instead - // &A::func; + // auto pmf1 = &A::func; } ``` diff --git a/docs/intrinsics/arm64-intrinsics.md b/docs/intrinsics/arm64-intrinsics.md index 51f00da5d9f..4456d24ace0 100644 --- a/docs/intrinsics/arm64-intrinsics.md +++ b/docs/intrinsics/arm64-intrinsics.md @@ -15,7 +15,7 @@ The Microsoft C++ compiler (MSVC) makes the following intrinsics available on th The NEON vector instruction set extensions for ARM64 provide Single Instruction Multiple Data (SIMD) capabilities. They resemble the ones in the MMX and SSE vector instruction sets that are common to x86 and x64 architecture processors. -NEON intrinsics are supported, as provided in the header file *arm64_neon.h*. The MSVC support for NEON intrinsics resembles that of the ARM64 compiler, which is documented in the [ARM NEON Intrinsic Reference](https://static.docs.arm.com/ihi0073/c/IHI0073C_arm_neon_intrinsics_ref.pdf) on the ARM Infocenter website. +NEON intrinsics are supported, as provided in the header file *arm64_neon.h*. The MSVC support for NEON intrinsics resembles that of the ARM64 compiler, which is documented in the [ARM NEON Intrinsic Reference](https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics) on the ARM Infocenter website. ## ARM64-specific intrinsics listing diff --git a/docs/standard-library/algorithm-functions.md b/docs/standard-library/algorithm-functions.md index 87918e06723..a2cc79dd1c4 100644 --- a/docs/standard-library/algorithm-functions.md +++ b/docs/standard-library/algorithm-functions.md @@ -8,7 +8,7 @@ helpviewer_keywords: ["std::adjacent_find [C++]", "std::all_of [C++]", "std::any --- # <algorithm> functions -## adjacent_find +## `adjacent_find` Searches for two adjacent elements that are either equal or satisfy a specified condition. @@ -40,16 +40,16 @@ ForwardIterator adjacent_find( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be searched. -*pred*\ +*`pred`*\ The binary predicate giving the condition to be satisfied by the values of the adjacent elements in the range being searched. ### Return value @@ -126,7 +126,7 @@ There are two adjacent elements where the second is twice the first. They have values of 10 & 20. ``` -## all_of +## `all_of` Returns **`true`** when a condition is present at each element in the given range. @@ -147,16 +147,16 @@ bool all_of( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates where to start to check for a condition. The iterator marks where a range of elements starts. -*last*\ +*`last`*\ An input iterator that indicates the end of the range of elements to check for a condition. -*pred*\ +*`pred`*\ A condition to test for. This is a user-defined predicate function object that defines the condition to be satisfied by an element being checked. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Return value @@ -202,7 +202,7 @@ li = ( 50 40 10 20 20 ) All the elements are even numbers. ``` -## any_of +## `any_of` Returns **`true`** when a condition is present at least once in the specified range of elements. @@ -223,16 +223,16 @@ bool any_of( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates where to start checking a range of elements for a condition. -*last*\ +*`last`*\ An input iterator that indicates the end of the range of elements to check for a condition. -*pred*\ +*`pred`*\ A condition to test for. This is provided by a user-defined predicate function object. The predicate defines the condition to be satisfied by the element being tested. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Return value @@ -279,7 +279,7 @@ li = ( 51 41 11 21 20 ) There's an even element in li. ``` -## binary_search +## `binary_search` Tests whether there is an element in a sorted range that is equal to a specified value or that is equivalent to it in a sense specified by a binary predicate. @@ -300,16 +300,16 @@ bool binary_search( ### Parameters -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be searched. -*value*\ +*`value`*\ The value required to be matched by the value of the element or that must satisfy the condition with the element value specified by the binary predicate. -*pred*\ +*`pred`*\ User-defined predicate function object that defines sense in which one element is less than another. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -418,7 +418,7 @@ Ordered using mod_lesser, vector v1 = ( 0 -1 1 -2 2 3 4 ) There is an element with a value equivalent to -3 under mod_lesser. ``` -## clamp +## `clamp` Compares a value to an upper and lower bound, and returns a reference to the value if it is between the bounds, or a reference to the upper or lower bound if the value is above or below them, respectively. @@ -439,27 +439,27 @@ constexpr const Type& clamp( ### Parameters -*value*\ -The value to compare to *upper* and *lower*. +*`value`*\ +The value to compare to *`upper`* and *`lower`*. -*lower*\ -The lower bound of values to clamp *value* to. +*`lower`*\ +The lower bound of values to clamp *`value`* to. -*upper*\ -The upper bound of values to clamp *value* to. +*`upper`*\ +The upper bound of values to clamp *`value`* to. -*pred*\ -A predicate used to compare *value* to *lower* or *upper*. A comparison predicate takes two arguments and returns **`true`** if the first is in some sense less than the second, and otherwise, **`false`**. +*`pred`*\ +A predicate used to compare *`value`* to *`lower`* or *`upper`*. A comparison predicate takes two arguments and returns **`true`** if the first is in some sense less than the second, and otherwise, **`false`**. ### Return value -Returns a reference to *lower* if `value < lower`, or a reference to *upper* if `upper < value`. Otherwise, it returns a reference to *value*. +Returns a reference to *`lower`* if `value < lower`, or a reference to *`upper`* if `upper < value`. Otherwise, it returns a reference to *`value`*. ### Remarks -The behavior is undefined if *upper* is less than *lower*. +The behavior is undefined if *`upper`* is less than *`lower`*. -## copy +## `copy` Assigns the values of elements from a source range to a destination range, iterating through the source sequence of elements and assigning them new positions in a forward direction. @@ -480,27 +480,27 @@ ForwardIterator2 copy( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the source range. -*last*\ +*`last`*\ An input iterator addressing the position that is one past the final element in the source range. -*destBeg*\ +*`destBeg`*\ An output iterator addressing the position of the first element in the destination range. ### Return value -An output iterator addressing the position that is one past the final element in the destination range, that is, the iterator addresses `result` + (*last* - *first*). +An output iterator addressing the position that is one past the final element in the destination range, that is, the iterator addresses `result` + (*`last`* - *`first`*). ### Remarks The source range must be valid and there must be sufficient space at the destination to hold all the elements being copied. -Because the algorithm copies the source elements in order beginning with the first element, the destination range can overlap with the source range provided the *last* position of the source range is not contained in the destination range. `copy` can be used to shift elements to the left but not the right, unless there is no overlap between the source and destination ranges. To shift to the right any number of positions, use the [copy_backward](algorithm-functions.md#copy_backward) algorithm. +Because the algorithm copies the source elements in order beginning with the first element, the destination range can overlap with the source range provided the *last* position of the source range is not contained in the destination range. `copy` can be used to shift elements to the left but not the right, unless there is no overlap between the source and destination ranges. To shift to the right any number of positions, use the [`copy_backward`](algorithm-functions.md#copy_backward) algorithm. The `copy` algorithm only modifies values pointed to by the iterators, assigning new values to elements in the destination range. It cannot be used to create new elements and cannot insert elements into an empty container directly. @@ -562,7 +562,7 @@ v2 with v1 insert = ( 0 3 6 9 0 10 20 21 24 27 30 ) v2 with shifted insert = ( 0 3 0 10 20 10 20 21 24 27 30 ) ``` -## copy_backward +## `copy_backward` Assigns the values of elements from a source range to a destination range, iterating through the source sequence of elements and assigning them new positions in a backward direction. @@ -576,18 +576,18 @@ BidirectionalIterator2 copy_backward( ### Parameters -*first*\ +*`first`*\ A bidirectional iterator addressing the position of the first element in the source range. -*last*\ +*`last`*\ A bidirectional iterator addressing the position that is one past the final element in the source range. -*destEnd*\ +*`destEnd`*\ A bidirectional iterator addressing the position of one past the final element in the destination range. ### Return value -An output iterator addressing the position that is one past the final element in the destination range, that is, the iterator addresses *destEnd* - (*last* - *first*). +An output iterator addressing the position that is one past the final element in the destination range, that is, the iterator addresses *`destEnd`* - (*`last`* - *`first`*). ### Remarks @@ -595,9 +595,9 @@ The source range must be valid and there must be sufficient space at the destina The `copy_backward` algorithm imposes more stringent requirements than that the `copy` algorithm. Both its input and output iterators must be bidirectional. -The `copy_backward` and [move_backward](algorithm-functions.md#move_backward) algorithms are the only C++ Standard Library algorithms designating the output range with an iterator pointing to the end of the destination range. +The `copy_backward` and [`move_backward`](algorithm-functions.md#move_backward) algorithms are the only C++ Standard Library algorithms designating the output range with an iterator pointing to the end of the destination range. -Because the algorithm copies the source elements in order beginning with the last element, the destination range can overlap with the source range provided the *first* position of the source range is not contained in the destination range. `copy_backward` can be used to shift elements to the right but not the left, unless there is no overlap between the source and destination ranges. To shift to the left any number of positions, use the [copy](algorithm-functions.md#copy) algorithm. +Because the algorithm copies the source elements in order beginning with the last element, the destination range can overlap with the source range provided the *first* position of the source range is not contained in the destination range. `copy_backward` can be used to shift elements to the right but not the left, unless there is no overlap between the source and destination ranges. To shift to the left any number of positions, use the [`copy`](algorithm-functions.md#copy) algorithm. The `copy_backward` algorithm only modifies values pointed to by the iterators, assigning new values to elements in the destination range. It cannot be used to create new elements and cannot insert elements into an empty container directly. @@ -659,7 +659,7 @@ v2 with v1 insert = ( 0 3 6 9 0 10 20 21 24 27 30 ) v2 with shifted insert = ( 0 3 6 9 0 10 0 10 20 27 30 ) ``` -## copy_if +## `copy_if` In a range of elements, copies the elements that are **`true`** for the specified condition. @@ -682,24 +682,24 @@ ForwardIterator2 copy_if( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates the start of a range to check for the condition. -*last*\ +*`last`*\ An input iterator that indicates the end of the range. -*dest*\ +*`dest`*\ The output iterator that indicates the destination for the copied elements. -*pred*\ +*`pred`*\ The condition against which every element in the range is tested. This condition is provided by a user-defined predicate function object. A unary predicate takes one argument and returns **`true`** or **`false`**. ### Return value -An output iterator that equals *dest* incremented once for each element that fulfills the condition. In other words, the return value minus *dest* equals the number of copied elements. +An output iterator that equals *`dest`* incremented once for each element that fulfills the condition. In other words, the return value minus *`dest`* equals the number of copied elements. ### Remarks @@ -707,7 +707,7 @@ The template function evaluates `if (pred(*first + N)) * dest++ = *(first + N))` -once for each `N` in the range `[0, last - first)`, for strictly increasing values of `N` starting with the lowest value. If *dest* and *first* designate regions of storage, *dest* must not be in the range `[ first, last )`. +once for each `N` in the range `[0, last - first)`, for strictly increasing values of `N` starting with the lowest value. If *`dest`* and *`first`* designate regions of storage, *`dest`* must not be in the range `[ first, last )`. ### Example @@ -764,7 +764,7 @@ Even numbers are le = ( 46 88 72 60 40 84 ) Odd numbers are lo = ( 59 79 71 5 ) ``` -## copy_n +## `copy_n` Copies a specified number of elements. @@ -785,25 +785,25 @@ ForwardIterator2 copy_n( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates where to copy elements from. -*count*\ +*`count`*\ A signed or unsigned integer type specifying the number of elements to copy. -*dest*\ +*`dest`*\ An output iterator that indicates where to copy elements to. ### Return value -Returns an output iterator where elements have been copied to. It is the same as the returned value of the *dest* parameter. +Returns an output iterator where elements have been copied to. It is the same as the returned value of the *`dest`* parameter. ### Remarks -The template function evaluates `*(dest + N) = *(first + N))` once for each `N` in the range `[0, count)`, for strictly increasing values of `N` starting with the lowest value. It then returns `dest + N`. If *dest* and *first* designate regions of storage, *dest* must not be in the range `[first, last)`. +The template function evaluates `*(dest + N) = *(first + N))` once for each `N` in the range `[0, count)`, for strictly increasing values of `N` starting with the lowest value. It then returns `dest + N`. If *`dest`* and *`first`* designate regions of storage, *`dest`* must not be in the range `[first, last)`. ### Example @@ -834,7 +834,7 @@ int main() dandelion + badger = danger ``` -## count +## `count` Returns the number of elements in a range whose values match a specified value. @@ -856,27 +856,27 @@ count( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range to be traversed. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range to be traversed. -*value*\ +*`value`*\ The value of the elements to be counted. ### Return value -The difference type of the `InputIterator` that counts the number of elements in the range [*first*, *last*) that have value *value*. +The difference type of the `InputIterator` that counts the number of elements in the range [*`first`*, *`last`*) that have value *`value`*. ### Remarks The `operator==` used to determine the match between an element and the specified value must impose an equivalence relation between its operands. -This algorithm is generalized to count elements that satisfy any predicate with the template function [count_if](algorithm-functions.md#count_if). +This algorithm is generalized to count elements that satisfy any predicate with the template function [`count_if`](algorithm-functions.md#count_if). ### Example @@ -915,7 +915,7 @@ v1 = ( 10 20 10 40 10 ) The number of 10s in v2 is: 3. ``` -## count_if +## `count_if` Returns the number of elements in a range whose values satisfy a specified condition. @@ -937,16 +937,16 @@ count_if( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range to be searched. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range to be searched. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if an element is to be counted. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Return value @@ -955,7 +955,7 @@ The number of elements that satisfy the condition specified by the predicate. ### Remarks -This template function is a generalization of the algorithm [count](algorithm-functions.md#count), replacing the predicate "equals a specific value" with any predicate. +This template function is a generalization of the algorithm [`count`](algorithm-functions.md#count), replacing the predicate "equals a specific value" with any predicate. ### Example @@ -1000,7 +1000,7 @@ v1 = ( 10 20 10 40 10 ) The number of elements in v1 greater than 10 is: 2. ``` -## equal +## `equal` Compares two ranges element by element for equality or equivalence in a sense specified by a binary predicate. @@ -1072,22 +1072,22 @@ bool equal( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first range to be tested. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first range to be tested. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in the second range to be tested. -*last2*\ +*`last2`*\ An input iterator addressing the position of one past the last element in the second range to be tested. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -1135,7 +1135,7 @@ int main() } ``` -## equal_range +## `equal_range` Given an ordered range, finds the subrange in which all elements are equivalent to a given value. @@ -1156,33 +1156,33 @@ pair equal_range( ### Parameters -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be searched. -*value*\ +*`value`*\ The value being searched for in the ordered range. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. A comparison predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value -A pair of forward iterators that specify a subrange, contained within the range searched, in which all of the elements are equivalent to *value* in the sense defined by the binary predicate used (either *pred* or the default, less-than). +A pair of forward iterators that specify a subrange, contained within the range searched, in which all of the elements are equivalent to *`value`* in the sense defined by the binary predicate used (either *`pred`* or the default, less-than). -If no elements in the range are equivalent to *value*, the forward iterators in the returned pair are equal and specify the point where *value* could be inserted without disturbing the order of the range. +If no elements in the range are equivalent to *`value`*, the forward iterators in the returned pair are equal and specify the point where *`value`* could be inserted without disturbing the order of the range. ### Remarks -The first iterator of the pair returned by the algorithm is [lower_bound](algorithm-functions.md#lower_bound), and the second iterator is [upper_bound](algorithm-functions.md#upper_bound). +The first iterator of the pair returned by the algorithm is [`lower_bound`](algorithm-functions.md#lower_bound), and the second iterator is [`upper_bound`](algorithm-functions.md#upper_bound). The range must be sorted according to the predicate provided to `equal_range`. For example, if you are going to use the greater-than predicate, the range must be sorted in descending order. Elements in the possibly empty subrange defined by the pair of iterators returned by `equal_range` will be equivalent to *value* in the sense defined by the predicate used. -The complexity of the algorithm is logarithmic for random-access iterators and linear otherwise, with the number of steps proportional to (*last* - *first*). +The complexity of the algorithm is logarithmic for random-access iterators and linear otherwise, with the number of steps proportional to (*`last`* - *`first`*). ### Example @@ -1301,7 +1301,7 @@ int main() } ``` -## fill +## `fill` Assigns the same new value to every element in a specified range. @@ -1322,17 +1322,17 @@ void fill( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be traversed. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be traversed. -*value*\ -The value to be assigned to elements in the range [*first*, *last*). +*`value`*\ +The value to be assigned to elements in the range [*`first`*, *`last`*). ### Remarks @@ -1379,7 +1379,7 @@ Vector v1 = ( 0 5 10 15 20 25 30 35 40 45 ) Modified v1 = ( 0 5 10 15 20 2 2 2 2 2 ) ``` -## fill_n +## `fill_n` Assigns a new value to a specified number of elements in a range beginning with a particular element. @@ -1400,21 +1400,21 @@ ForwardIterator fill_n( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ -An output iterator addressing the position of the first element in the range to be assigned the value *value*. +*`first`*\ +An output iterator addressing the position of the first element in the range to be assigned the value *`value`*. -*count*\ +*`count`*\ A signed or unsigned integer type specifying the number of elements to be assigned the value. -*value*\ -The value to be assigned to elements in the range [*first*, *first + count*). +*`value`*\ +The value to be assigned to elements in the range [*`first`*, *`first + count`*). ### Return value -An iterator to the element that follows the last element filled if *count* > zero, otherwise the first element. +An iterator to the element that follows the last element filled if *`count`* > zero, otherwise the first element. ### Remarks @@ -1468,7 +1468,7 @@ int main() } ``` -## find +## `find` Locates the position of the first occurrence of an element in a range that has a specified value. @@ -1489,29 +1489,29 @@ ForwardIterator find( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range to be searched for the specified value. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range to be searched for the specified value. -*value*\ +*`value`*\ The value to be searched for. ### Return value -An input iterator addressing the first occurrence of the specified value in the range being searched. If no element is found with an equivalent value, returns *last*. +An input iterator addressing the first occurrence of the specified value in the range being searched. If no element is found with an equivalent value, returns *`last`*. ### Remarks The `operator==` used to determine the match between an element and the specified value must impose an equivalence relation between its operands. -For a code example using `find()`, see [find_if](algorithm-functions.md#find_if). +For a code example using `find()`, see [`find_if`](algorithm-functions.md#find_if). -## find_end +## `find_end` Looks in a range for the last subsequence that is identical to a specified sequence or that is equivalent in a sense specified by a binary predicate. @@ -1554,19 +1554,19 @@ find_end( ### Parameters -*first1*\ +*`first1`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last1*\ +*`last1`*\ A forward iterator addressing the position one past the last element in the range to be searched. -*first2*\ +*`first2`*\ A forward iterator addressing the position of the first element in the range to search for. -*last2*\ +*`last2`*\ A forward iterator addressing the position one past the last element in the range to search for. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -1675,7 +1675,7 @@ There is a sequence of elements in v1 that are equivalent to those in v2 under the binary predicate twice and that begins at position 8. ``` -## find_first_of +## `find_first_of` Searches for the first occurrence of any of several values within a target range or for the first occurrence of any of several elements that are equivalent in a sense specified by a binary predicate to a specified set of the elements. @@ -1718,19 +1718,19 @@ find_first_of( ### Parameters -*first1*\ +*`first1`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last1*\ +*`last1`*\ A forward iterator addressing the position one past the final element in the range to be searched. -*first2*\ +*`first2`*\ A forward iterator addressing the position of the first element in the range to be matched. -*last2*\ +*`last2`*\ A forward iterator addressing the position one past the final element in the range to be matched. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -1842,7 +1842,7 @@ to those in v2 under the binary predicate twice and the first one begins at position 2. ``` -## find_if +## `find_if` Locates the position of the first occurrence of an element in a range that satisfies a specified condition. @@ -1862,22 +1862,22 @@ ForwardIterator find_if( ### Parameters -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range to be searched. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range to be searched. -*pred*\ -User-defined predicate function object or [lambda expression](../cpp/lambda-expressions-in-cpp.md) that defines the condition to be satisfied by the element being searched for. A unary predicate takes a single argument and returns **`true`** if satisfied, or **`false`** if not satisfied. The signature of *pred* must effectively be `bool pred(const T& arg);`, where `T` is a type to which `InputIterator` can be implicitly converted when dereferenced. The **`const`** keyword is shown only to illustrate that the function object or lambda should not modify the argument. +*`pred`*\ +User-defined predicate function object or [lambda expression](../cpp/lambda-expressions-in-cpp.md) that defines the condition to be satisfied by the element being searched for. A unary predicate takes a single argument and returns **`true`** if satisfied, or **`false`** if not satisfied. The signature of *`pred`* must effectively be `bool pred(const T& arg);`, where `T` is a type to which `InputIterator` can be implicitly converted when dereferenced. The **`const`** keyword is shown only to illustrate that the function object or lambda should not modify the argument. ### Return value -An input iterator that refers to the first element in the range that satisfies the condition specified by the predicate (the predicate results in **`true`**). If no element is found to satisfy the predicate, returns *last*. +An input iterator that refers to the first element in the range that satisfies the condition specified by the predicate (the predicate results in **`true`**). If no element is found to satisfy the predicate, returns *`last`*. ### Remarks -This template function is a generalization of the algorithm [find](algorithm-functions.md#find), replacing the predicate "equals a specific value" with any predicate. For the logical opposite (find the first element that does not satisfy the predicate), see [find_if_not](algorithm-functions.md#find_if_not). +This template function is a generalization of the algorithm [`find`](algorithm-functions.md#find), replacing the predicate "equals a specific value" with any predicate. For the logical opposite (find the first element that does not satisfy the predicate), see [`find_if_not`](algorithm-functions.md#find_if_not). ### Example @@ -1964,7 +1964,7 @@ int main() } ``` -## find_if_not +## `find_if_not` Returns the first element in the indicated range that does not satisfy a condition. @@ -1984,26 +1984,26 @@ ForwardIterator find_if_not( ### Parameters -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range to be searched. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range to be searched. -*pred*\ -User-defined predicate function object or [lambda expression](../cpp/lambda-expressions-in-cpp.md) that defines the condition to be not satisfied by the element being searched for. A unary predicate takes a single argument and returns **`true`** if satisfied, or **`false`** if not satisfied. The signature of *pred* must effectively be `bool pred(const T& arg);`, where `T` is a type to which `InputIterator` can be implicitly converted when dereferenced. The **`const`** keyword is shown only to illustrate that the function object or lambda should not modify the argument. +*`pred`*\ +User-defined predicate function object or [lambda expression](../cpp/lambda-expressions-in-cpp.md) that defines the condition to be not satisfied by the element being searched for. A unary predicate takes a single argument and returns **`true`** if satisfied, or **`false`** if not satisfied. The signature of *`pred`* must effectively be `bool pred(const T& arg);`, where `T` is a type to which `InputIterator` can be implicitly converted when dereferenced. The **`const`** keyword is shown only to illustrate that the function object or lambda should not modify the argument. ### Return value -An input iterator that refers to the first element in the range that does not satisfy the condition specified by the predicate (the predicate results in **`false`**). If all elements satisfy the predicate (the predicate results in **`true`** for every element), returns *last*. +An input iterator that refers to the first element in the range that does not satisfy the condition specified by the predicate (the predicate results in **`false`**). If all elements satisfy the predicate (the predicate results in **`true`** for every element), returns *`last`*. ### Remarks -This template function is a generalization of the algorithm [find](algorithm-functions.md#find), replacing the predicate "equals a specific value" with any predicate. For the logical opposite (find the first element that does satisfy the predicate), see [find_if](algorithm-functions.md#find_if). +This template function is a generalization of the algorithm [`find`](algorithm-functions.md#find), replacing the predicate "equals a specific value" with any predicate. For the logical opposite (find the first element that does satisfy the predicate), see [`find_if`](algorithm-functions.md#find_if). -For a code example readily adaptable to `find_if_not()`, see [find_if](algorithm-functions.md#find_if). +For a code example readily adaptable to `find_if_not()`, see [`find_if`](algorithm-functions.md#find_if). -## for_each +## `for_each` Applies a specified function object to each element in a forward order within a range and returns the function object. @@ -2024,13 +2024,13 @@ void for_each( ### Parameters -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range to be operated on. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range operated on. -*func*\ +*`func`*\ User-defined function object that is applied to each element in the range. ### Return value @@ -2043,7 +2043,7 @@ The algorithm `for_each` is very flexible, allowing the modification of each ele The range referenced must be valid; all pointers must be dereferenceable and, within the sequence, the last position must be reachable from the first by incrementation. -The complexity is linear with at most (*last* - *first*) comparisons. +The complexity is linear with at most (*`last`* - *`first`*) comparisons. ### Example @@ -2158,7 +2158,7 @@ The average of the elements of v1 is: Average ( v1mod2 ) = 10. ``` -## for_each_n +## `for_each_n` ```cpp template @@ -2175,7 +2175,7 @@ ForwardIterator for_each_n( Function f); ``` -## generate +## `generate` Assigns the values generated by a function object to each element in a range. @@ -2195,13 +2195,13 @@ void generate( ### Parameters -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to which values are to be assigned. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to which values are to be assigned. -*gen*\ +*`gen`*\ A function object that is called with no arguments that is used to generate the values to be assigned to each of the elements in the range. ### Remarks @@ -2255,7 +2255,7 @@ Vector v1 is ( 41 18467 6334 26500 19169 ). Deque deq1 is ( 15724 11478 29358 26962 24464 ). ``` -## generate_n +## `generate_n` Assigns the values generated by a function object to a specified number of elements in a range and returns to the position one past the last assigned value. @@ -2276,16 +2276,16 @@ ForwardIterator generate_n( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An output iterator addressing the position of first element in the range to which values are to be assigned. -*count*\ +*`count`*\ A signed or unsigned integer type specifying the number of elements to be assigned a value by the generator function. -*gen*\ +*`gen`*\ A function object that is called with no arguments that is used to generate the values to be assigned to each of the elements in the range. ### Remarks @@ -2341,7 +2341,7 @@ int main() } ``` -## includes +## `includes` Tests whether one sorted range contains all the elements contained in a second sorted range, where the ordering or equivalence criterion between elements may be specified by a binary predicate. @@ -2381,22 +2381,22 @@ bool includes( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first of two sorted source ranges to be tested for whether all the elements of the second are contained in the first. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first of two sorted source ranges to be tested for whether all the elements of the second are contained in the first. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in second of two consecutive sorted source ranges to be tested for whether all the elements of the second are contained in the first. -*last2*\ +*`last2`*\ An input iterator addressing the position one past the last element in second of two consecutive sorted source ranges to be tested for whether all the elements of the second are contained in the first. -*pred*\ +*`pred`*\ User-defined predicate function object that defines sense in which one element is less than another. A comparison predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -2566,7 +2566,7 @@ At least one of the elements in vector v2b is not contained in vector v2a. At least one of the elements in vector v3b is not contained under mod_lesser in vector v3a. ``` -## inplace_merge +## `inplace_merge` Combines the elements from two consecutive sorted ranges into a single sorted range, where the ordering criterion may be specified by a binary predicate. @@ -2602,19 +2602,19 @@ void inplace_merge( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A bidirectional iterator addressing the position of the first element in the first of two consecutive sorted ranges to be combined and sorted into a single range. -*middle*\ +*`middle`*\ A bidirectional iterator addressing the position of the first element in the second of two consecutive sorted ranges to be combined and sorted into a single range. -*last*\ +*`last`*\ A bidirectional iterator addressing the position one past the last element in the second of two consecutive sorted ranges to be combined and sorted into a single range. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The comparison predicate takes two arguments and should return **`true`** when the first element is less than the second element and **`false`** otherwise. ### Remarks @@ -2623,7 +2623,7 @@ The sorted consecutive ranges referenced must be valid; all pointers must be der The sorted consecutive ranges must each be arranged as a precondition to the application of the `inplace_merge` algorithm in accordance with the same ordering as is to be used by the algorithm to sort the combined ranges. The operation is stable as the relative order of elements within each range is preserved. When there are equivalent elements in both source ranges, the element is the first range precedes the element from the second in the combined range. -The complexity depends on the available memory as the algorithm allocates memory to a temporary buffer. If sufficient memory is available, the best case is linear with `(last - first) - 1` comparisons; if no auxiliary memory is available, the worst case is `N log(N)`, where *N* = *last* - *first*. +The complexity depends on the available memory as the algorithm allocates memory to a temporary buffer. If sufficient memory is available, the best case is linear with `(last - first) - 1` comparisons; if no auxiliary memory is available, the worst case is `N log(N)`, where *`N`* = *`last`* - *`first`*. ### Example @@ -2768,16 +2768,16 @@ bool is_heap( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A random access iterator that indicates the start of a range to check for a heap. -*last*\ +*`last`*\ A random access iterator that indicates the end of a range. -*pred*\ +*`pred`*\ A condition to test to order elements. A comparison predicate takes two arguments and returns **`true`** or **`false`**. ### Return value @@ -2786,7 +2786,7 @@ Returns **`true`** if the elements in the specified range form a heap, **`false` ### Remarks -The first template function returns [is_heap_until](algorithm-functions.md#is_heap_until)`(first , last) == last`. +The first template function returns [`is_heap_until`](algorithm-functions.md#is_heap_until)`(first , last) == last`. The second template function returns @@ -2794,7 +2794,7 @@ The second template function returns ## is_heap_until -Returns an iterator positioned at the first element in the range [ `first`, `last`) that does not satisfy the heap ordering condition, or *end* if the range forms a heap. +Returns an iterator positioned at the first element in the range [ `first`, `last`) that does not satisfy the heap ordering condition, or *`end`* if the range forms a heap. ```cpp template @@ -2824,27 +2824,27 @@ RandomAccessIterator is_heap_until( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A random access iterator that specifies the first element of a range to check for a heap. -*last*\ +*`last`*\ A random access iterator that specifies the end of the range to check for a heap. -*pred*\ -A binary predicate that specifies the strict weak ordering condition that defines a heap. The default predicate is `std::less<>` when *pred* isn't specified. +*`pred`*\ +A binary predicate that specifies the strict weak ordering condition that defines a heap. The default predicate is `std::less<>` when *`pred`* isn't specified. ### Return value -Returns *last* if the specified range forms a heap or contains one or fewer elements. Otherwise, returns an iterator for the first element found that does not satisfy the heap condition. +Returns *`last`* if the specified range forms a heap or contains one or fewer elements. Otherwise, returns an iterator for the first element found that does not satisfy the heap condition. ### Remarks -The first template function returns the last iterator `next` in `[first, last)` where `[first, next)` is a heap ordered by the function object `std::less<>`. If the distance `last - first` is less than 2, the function returns *last*. +The first template function returns the last iterator `next` in `[first, last)` where `[first, next)` is a heap ordered by the function object `std::less<>`. If the distance `last - first` is less than 2, the function returns *`last`*. -The second template function behaves the same as the first, except that it uses the predicate *pred* instead of `std::less<>` as the heap ordering condition. +The second template function behaves the same as the first, except that it uses the predicate *`pred`* instead of `std::less<>` as the heap ordering condition. ## is_partitioned @@ -2867,16 +2867,16 @@ bool is_partitioned( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates where a range starts to check for a condition. -*last*\ +*`last`*\ An input iterator that indicates the end of a range. -*pred*\ +*`pred`*\ The condition to test for. This is provided by a user-defined predicate function object that defines the condition to be satisfied by the element being searched for. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Return value @@ -2887,7 +2887,7 @@ Returns **`true`** when all of the elements in the given range that test **`true The template function returns **`true`** only if all elements in `[first, last)` are partitioned by *pred*; that is, all elements `X` in `[first, last)` for which `pred (X)` is true occur before all elements `Y` for which `pred (Y)` is **`false`**. -## is_permutation +## `is_permutation` Returns true if both ranges contain the same elements, whether or not the elements are in the same order. Use the dual-range overloads in C++14 code because the overloads that only take a single iterator for the second range will not detect differences if the second range is longer than the first range, and will result in undefined behavior if the second range is shorter than the first range. @@ -2924,19 +2924,19 @@ bool is_permutation( ### Parameters -*first1*\ +*`first1`*\ A forward iterator that refers to the first element of the range. -*last1*\ +*`last1`*\ A forward iterator that refers one past the last element of the range. -*first2*\ +*`first2`*\ A forward iterator that refers to the first element of a second range, used for comparison. -*last2*\ +*`last2`*\ A forward iterator that refers to one past the last element of a second range, used for comparison. -*pred*\ +*`pred`*\ A predicate that tests for equivalence and returns a **`bool`**. ### Return value @@ -2947,7 +2947,7 @@ A predicate that tests for equivalence and returns a **`bool`**. `is_permutation` has quadratic complexity in the worst case. -The first template function assumes that there are as many elements in the range beginning at *first2* as there are in the range designated by `[first1, last1)`. If there are more elements in the second range, they are ignored; if there are less, undefined behavior will occur. The third template function (C++14 and later) does not make this assumption. Both return **`true`** only if, for each element X in the range designated by `[first1, last1)` there are as many elements Y in the same range for which X == Y as there are in the range beginning at *first2* or `[first2, last2)`. Here, `operator==` must perform a pairwise comparison between its operands. +The first template function assumes that there are as many elements in the range beginning at *first2* as there are in the range designated by `[first1, last1)`. If there are more elements in the second range, they are ignored; if there are less, undefined behavior will occur. The third template function (C++14 and later) does not make this assumption. Both return **`true`** only if, for each element X in the range designated by `[first1, last1)` there are as many elements Y in the same range for which X == Y as there are in the range beginning at *`first2`* or `[first2, last2)`. Here, `operator==` must perform a pairwise comparison between its operands. The second and fourth template functions behave the same, except that they replace `operator==(X, Y)` with `Pred(X, Y)`. To behave correctly, the predicate must be symmetric, reflexive and transitive. @@ -3007,7 +3007,7 @@ int main() } ``` -## is_sorted +## `is_sorted` Returns **`true`** if the elements in the specified range are in sorted order. @@ -3039,25 +3039,25 @@ bool is_sorted( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator that indicates where the range to check begins. -*last*\ +*`last`*\ A forward iterator that indicates the end of a range. -*pred*\ +*`pred`*\ The condition to test to determine an order between two elements. A comparison predicate takes two arguments and returns **`true`** or **`false`**. This performs the same task as `operator<`. ### Remarks -The first template function returns [is_sorted_until](#is_sorted_until)`( first, last ) == last`. The `operator<` function performs the order comparison. +The first template function returns [`is_sorted_until`](#is_sorted_until)`( first, last ) == last`. The `operator<` function performs the order comparison. -The second template function returns `is_sorted_until( first, last , pred ) == last`. The *pred* predicate function performs the order comparison. +The second template function returns `is_sorted_until( first, last , pred ) == last`. The *`pred`* predicate function performs the order comparison. -## is_sorted_until +## `is_sorted_until` Returns a `ForwardIterator` that is set to the last element that is in sorted order from a specified range. @@ -3091,29 +3091,29 @@ ForwardIterator is_sorted_until( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator that indicates where the range to check starts. -*last*\ +*`last`*\ A forward iterator that indicates the end of a range. -*pred*\ +*`pred`*\ The condition to test to determine an order between two elements. A comparison predicate takes two arguments and returns **`true`** or **`false`**. ### Return value -Returns a `ForwardIterator` set to the last element in sorted order. The sorted sequence starts from *first*. +Returns a `ForwardIterator` set to the last element in sorted order. The sorted sequence starts from *`first`*. ### Remarks -The first template function returns the last iterator `next` in `[first, last]` so that `[first, next)` is a sorted sequence ordered by `operator<`. If `distance()` is less than 2, the function returns *last*. +The first template function returns the last iterator `next` in `[first, last]` so that `[first, next)` is a sorted sequence ordered by `operator<`. If `distance()` is less than 2, the function returns *`last`*. The second template function behaves the same, except that it replaces `operator<(X, Y)` with `pred(X, Y)`. -## iter_swap +## `iter_swap` Exchanges two values referred to by a pair of specified iterators. @@ -3124,10 +3124,10 @@ void iter_swap( ForwardIterator1 left, ForwardIterator2 right ); ### Parameters -*left*\ +*`left`*\ One of the forward iterators whose value is to be exchanged. -*right*\ +*`right`*\ The second of the forward iterators whose value is to be exchanged. ### Remarks @@ -3269,7 +3269,7 @@ vector v1 is: v1 = ( 4 1 2 3 ). & deque deq2 is: deq2 = ( 0 5 ). ``` -## lexicographical_compare +## `lexicographical_compare` Compares element by element between two sequences to determine which is lesser of the two. @@ -3309,22 +3309,22 @@ bool lexicographical_compare( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first range to be compared. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the final element in the first range to be compared. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in the second range to be compared. -*last2*\ +*`last2`*\ An input iterator addressing the position one past the final element in the second range to be compared. -*pred*\ +*`pred`*\ User-defined predicate function object that defines sense in which one element is less than another. A comparison predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -3436,7 +3436,7 @@ Vector v1 is lexicographically_less than L1. Vector v1 is not lexicographically_less than v2 under twice. ``` -## lower_bound +## `lower_bound` Finds the position of the first element in an ordered range that has a value greater than or equivalent to a specified value, where the ordering criterion may be specified by a binary predicate. @@ -3457,16 +3457,16 @@ ForwardIterator lower_bound( ### Parameters -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be searched. -*value*\ +*`value`*\ The value whose first position or possible first position is being searched for in the ordered range. -*pred*\ +*`pred`*\ User-defined predicate function object that defines sense in which one element is less than another. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -3575,7 +3575,7 @@ int main() } ``` -## make_heap +## `make_heap` Converts elements from a specified range into a heap in which the first element is the largest and for which a sorting criterion may be specified with a binary predicate. @@ -3594,13 +3594,13 @@ void make_heap( ### Parameters -*first*\ +*`first`*\ A random-access iterator addressing the position of the first element in the range to be converted into a heap. -*last*\ +*`last`*\ A random-access iterator addressing the position one past the final element in the range to be converted into a heap. -*pred*\ +*`pred`*\ User-defined predicate function object that defines sense in which one element is less than another. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Remarks @@ -3657,7 +3657,7 @@ int main() { } ``` -## max +## `max` Compares two objects and returns the larger of the two, where the ordering criterion may be specified by a binary predicate. @@ -3682,25 +3682,25 @@ constexpr Type& max( ### Parameters -*left*\ +*`left`*\ The first of the two objects being compared. -*right*\ +*`right`*\ The second of the two objects being compared. -*pred*\ +*`pred`*\ A binary predicate used to compare the two objects. -*inlist*\ +*`inlist`*\ The initializer list that contains the objects to be compared. ### Return value -The greater of the two objects, unless neither is greater; in that case, it returns the first of the two objects. In the case of an initializer_list, it returns the greatest of the objects in the list. +The greater of the two objects, unless neither is greater; in that case, it returns the first of the two objects. In the case of an `initializer_list`, it returns the greatest of the objects in the list. ### Remarks -The `max` algorithm is unusual in having objects passed as parameters. Most C++ Standard Library algorithms operate on a range of elements whose position is specified by iterators passed as parameters. If you need a function that operates on a range of elements, use [max_element](algorithm-functions.md#max_element) instead. Visual Studio 2017 enables **`constexpr`** on the overloads that take an initializer_list. +The `max` algorithm is unusual in having objects passed as parameters. Most C++ Standard Library algorithms operate on a range of elements whose position is specified by iterators passed as parameters. If you need a function that operates on a range of elements, use [`max_element`](algorithm-functions.md#max_element) instead. Visual Studio 2017 enables **`constexpr`** on the overloads that take an `initializer_list`. ### Example @@ -3870,7 +3870,7 @@ Vector v4 = max (v1,v2) is ( 0 1 2 ). Vector v5 = max (v1,v3) is ( 0 2 4 ). ``` -## max_element +## `max_element` Finds the first occurrence of largest element in a specified range where the ordering criterion may be specified by a binary predicate. @@ -3902,16 +3902,16 @@ ForwardIterator max_element( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be searched for the largest element. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be searched for the largest element. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The comparison predicate takes two arguments and should return **`true`** when the first element is less than the second element and **`false`** otherwise. ### Return value @@ -4024,7 +4024,7 @@ int main() } ``` -## merge +## `merge` Combines all of the elements from two sorted source ranges into a single, sorted destination range, where the ordering criterion may be specified by a binary predicate. @@ -4068,25 +4068,25 @@ ForwardIterator merge( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first of two sorted source ranges to be combined and sorted into a single range. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first of two sorted source ranges to be combined and sorted into a single range. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in second of two consecutive sorted source ranges to be combined and sorted into a single range. -*last2*\ +*`last2`*\ An input iterator addressing the position one past the last element in second of two consecutive sorted source ranges to be combined and sorted into a single range. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range where the two source ranges are to be combined into a single sorted range. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The comparison predicate takes two arguments and should return **`true`** when the first element is less than the second element, and **`false`** otherwise. ### Return value @@ -4107,7 +4107,7 @@ The value types of the input iterators need be less-than comparable to be ordere The complexity of the algorithm is linear with at most `(last1 - first1) - (last2 - first2) - 1` comparisons. -The [list class](list-class.md) provides a member function "merge" to merge the elements of two lists. +The [`list` class](list-class.md) provides a member function `merge` to merge the elements of two lists. ### Example @@ -4219,7 +4219,7 @@ int main() { } ``` -## min +## `min` Compares two objects and returns the lesser of the two, where the ordering criterion may be specified by a binary predicate. @@ -4247,16 +4247,16 @@ constexpr Type min( ### Parameters -*left*\ +*`left`*\ The first of the two objects being compared. -*right*\ +*`right`*\ The second of the two objects being compared. -*pred*\ +*`pred`*\ A binary predicate used to compare the two objects. -*inlist*\ +*`inlist`*\ The `initializer_list` that contains the members to be compared. ### Return value @@ -4265,7 +4265,7 @@ The lesser of the two objects, unless neither is lesser; in that case, it return ### Remarks -The `min` algorithm is unusual in having objects passed as parameters. Most C++ Standard Library algorithms operate on a range of elements whose position is specified by iterators passed as parameters. If you need a function that uses a range of elements, use [min_element](algorithm-functions.md#min_element). [constexpr](../cpp/constexpr-cpp.md) was enabled on the `initializer_list` overloads in Visual Studio 2017. +The `min` algorithm is unusual in having objects passed as parameters. Most C++ Standard Library algorithms operate on a range of elements whose position is specified by iterators passed as parameters. If you need a function that uses a range of elements, use [`min_element`](algorithm-functions.md#min_element). [`constexpr`](../cpp/constexpr-cpp.md) was enabled on the `initializer_list` overloads in Visual Studio 2017. ### Example @@ -4434,7 +4434,7 @@ Vector v4 = min ( v1,v2 ) is ( 0 1 2 ). Vector v5 = min ( v1,v3 ) is ( 0 1 2 ). ``` -## min_element +## `min_element` Finds the first occurrence of smallest element in a specified range where the ordering criterion may be specified by a binary predicate. @@ -4466,16 +4466,16 @@ ForwardIterator min_element( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be searched for the smallest element. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be searched for the smallest element. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The comparison predicate takes two arguments and should return **`true`** when the first element is less than the second element, and **`false`** otherwise. ### Return value @@ -4598,7 +4598,7 @@ The smallest element in v1 under the mod_lesser binary predicate is: 0 ``` -## minmax_element +## `minmax_element` Performs the work performed by `min_element` and `max_element` in one call. @@ -4630,16 +4630,16 @@ pair minmax_element( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator that indicates the beginning of a range. -*last*\ +*`last`*\ A forward iterator that indicates the end of a range. -*pred*\ +*`pred`*\ A user-defined predicate function object that defines the sense in which one element is less than another. The comparison predicate takes two arguments and should return **`true`** when the first is less than the second, and **`false`** otherwise. ### Return value @@ -4658,7 +4658,7 @@ The second template function behaves the same, except that it replaces `operator If the sequence is non-empty, the function performs at most `3 * (last - first - 1) / 2` comparisons. -## minmax +## `minmax` Compares two input parameters and returns them as a pair, in order of lesser to greater. @@ -4686,29 +4686,29 @@ constexpr pair minmax( ### Parameters -*left*\ +*`left`*\ The first of the two objects being compared. -*right*\ +*`right`*\ The second of the two objects being compared. -*pred*\ +*`pred`*\ A binary predicate used to compare the two objects. -*inlist*\ +*`inlist`*\ The `initializer_list` that contains the members to be compared. ### Remarks -The first template function returns `pair( right, left )` if *right* is less than *left*. Otherwise, it returns `pair( left, right )`. +The first template function returns `pair( right, left )` if *`right`* is less than *`left`*. Otherwise, it returns `pair( left, right )`. -The second member function returns a pair where the first element is the lesser and the second is the greater when compared by the predicate *pred*. +The second member function returns a pair where the first element is the lesser and the second is the greater when compared by the predicate *`pred`*. -The remaining template functions behave the same, except that they replace the *left* and *right* parameters with *inlist*. +The remaining template functions behave the same, except that they replace the *`left`* and *`right`* parameters with *`inlist`*. The function performs exactly one comparison. -## mismatch +## `mismatch` Compares two ranges element by element and locates the first position where a difference occurs. @@ -4786,22 +4786,22 @@ mismatch( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first range to be tested. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first range to be tested. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in the second range to be tested. -*last2*\ +*`last2`*\ An input iterator addressing the position of one past the last element in the second range to be tested. -*pred*\ +*`pred`*\ User-defined predicate function object that compares the current elements in each range and determines whether they are equivalent. It returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -4913,7 +4913,7 @@ C++14: vec_1 and list_1 are a mismatch: false Press a key ``` -## <alg> move +## ` move` Move elements associated with a specified range. @@ -4934,23 +4934,23 @@ ForwardIterator2 move( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates where to start the range of elements to move. -*last*\ +*`last`*\ An input iterator that indicates the end of a range of elements to move. -*dest*\ +*`dest`*\ The output iterator that is to contain the moved elements. ### Remarks -The template function evaluates `*(dest + N) = move(*(first + N))` once for each `N` in the range `[0, last - first)`, for strictly increasing values of `N` starting with the lowest value. It then returns `dest + N`. If `dest` and *first* designate regions of storage, *dest* must not be in the range `[first, last)`. +The template function evaluates `*(dest + N) = move(*(first + N))` once for each `N` in the range `[0, last - first)`, for strictly increasing values of `N` starting with the lowest value. It then returns `dest + N`. If `dest` and *`first`* designate regions of storage, *`dest`* must not be in the range `[first, last)`. -## move_backward +## `move_backward` Moves the elements of one iterator to another. The move starts with the last element in a specified range, and ends with the first element in that range. @@ -4964,22 +4964,22 @@ BidirectionalIterator2 move_backward( ### Parameters -*first*\ +*`first`*\ An iterator that indicates the start of a range to move elements from. -*last*\ +*`last`*\ An iterator that indicates the end of a range to move elements from. This element is not moved. -*destEnd*\ +*`destEnd`*\ A bidirectional iterator addressing the position of one past the final element in the destination range. ### Remarks -The template function evaluates `*(destEnd - N - 1) = move(*(last - N - 1))` once for each `N` in the range `[0, last - first)`, for strictly increasing values of `N` starting with the lowest value. It then returns `destEnd - (last - first)`. If *destEnd* and *first* designate regions of storage, *destEnd* must not be in the range `[first, last)`. +The template function evaluates `*(destEnd - N - 1) = move(*(last - N - 1))` once for each `N` in the range `[0, last - first)`, for strictly increasing values of `N` starting with the lowest value. It then returns `destEnd - (last - first)`. If *`destEnd`* and *`first`* designate regions of storage, *`destEnd`* must not be in the range `[first, last)`. `move` and `move_backward` are functionally equivalent to using `copy` and `copy_backward` with a move iterator. -## next_permutation +## `next_permutation` Reorders the elements in a range so that the original ordering is replaced by the lexicographically next greater permutation if it exists, where the sense of next may be specified with a binary predicate. @@ -4998,13 +4998,13 @@ bool next_permutation( ### Parameters -*first*\ +*`first`*\ A bidirectional iterator pointing to the position of the first element in the range to be permuted. -*last*\ +*`last`*\ A bidirectional iterator pointing to the position one past the final element in the range to be permuted. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the comparison criterion to be satisfied by successive elements in the ordering. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -5158,7 +5158,7 @@ After another next_permutation of vector v1, v1 = ( -3 -2 -1 1 0 2 3 ). ``` -## nth_element +## `nth_element` Partitions a range of elements, correctly locating the *n*th element of the sequence in the range so that all the elements in front of it are less than or equal to it and all the elements that follow it in the sequence are greater than or equal to it. @@ -5194,19 +5194,19 @@ void nth_element( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A random-access iterator addressing the position of the first element in the range to be partitioned. -*nth*\ +*`nth`*\ A random-access iterator addressing the position of element to be correctly ordered on the boundary of the partition. -*last*\ +*`last`*\ A random-access iterator addressing the position one past the final element in the range to be partitioned. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the comparison criterion to be satisfied by successive elements in the ordering. A comparison predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Remarks @@ -5217,7 +5217,7 @@ The `nth_element` algorithm does not guarantee that elements in the sub-ranges e Elements are equivalent, but not necessarily equal, if neither is less than the other. -The average of a sort complexity is linear with respect to *last - first*. +The average of a sort complexity is linear with respect to *`last - first`*. ### Example @@ -5285,7 +5285,7 @@ int main() { } ``` -## none_of +## `none_of` Returns **`true`** when a condition is never present among elements in the given range. @@ -5306,16 +5306,16 @@ bool none_of( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates where to start to check a range of elements for a condition. -*last*\ +*`last`*\ An input iterator that indicates the end of a range of elements. -*pred*\ +*`pred`*\ The condition to test for. This is provided by a user-defined predicate function object that defines the condition. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Return value @@ -5326,7 +5326,7 @@ Returns **`true`** if the condition is not detected at least once in the indicat The template function returns **`true`** only if, for some `N` in the range `[0, last - first)`, the predicate `pred(*(first + N))` is always **`false`**. -## partial_sort +## `partial_sort` Arranges a specified number of the smaller elements in a range into a nondescending order or according to an ordering criterion specified by a binary predicate. @@ -5362,19 +5362,19 @@ void partial_sort( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A random-access iterator addressing the position of the first element in the range to be sorted. -*sortEnd*\ +*`sortEnd`*\ A random-access iterator addressing the position one past the final element in the subrange to be sorted. -*last*\ +*`last`*\ A random-access iterator addressing the position one past the final element in the range to be partially sorted. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the comparison criterion to be satisfied by successive elements in the ordering. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Remarks @@ -5457,7 +5457,7 @@ Partially resorted (UDgreater) vector: v1 = ( 11 10 9 8 7 6 5 4 0 1 2 3 ) ``` -## partial_sort_copy +## `partial_sort_copy` Copies elements from a source range into a destination range where the source elements are ordered by either less than or another specified binary predicate. @@ -5497,22 +5497,22 @@ RandomAccessIterator partial_sort_copy( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the source range. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the final element in the source range. -*first2*\ +*`first2`*\ A random-access iterator addressing the position of the first element in the sorted destination range. -*last2*\ +*`last2`*\ A random-access iterator addressing the position one past the final element in the sorted destination range. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the comparison criterion to be satisfied by successive elements in the ordering. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -5601,7 +5601,7 @@ int main() { } ``` -## partition +## `partition` Classifies elements in a range into two disjoint sets, with those elements satisfying a unary predicate preceding those that fail to satisfy it. @@ -5622,16 +5622,16 @@ ForwardIterator partition( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A bidirectional iterator addressing the position of the first element in the range to be partitioned. -*last*\ +*`last`*\ A bidirectional iterator addressing the position one past the final element in the range to be partitioned. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if an element is to be classified. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Return value @@ -5642,9 +5642,9 @@ A bidirectional iterator addressing the position of the first element in the ran The range referenced must be valid; all pointers must be dereferenceable and within the sequence the last position is reachable from the first by incrementation. -Elements *a* and *b* are equivalent, but not necessarily equal, if both `pred( a, b )` is false and `pred( b, a )` is false, where *pred* is the parameter-specified predicate. The `partition` algorithm is not stable and does not guarantee that the relative ordering of equivalent elements will be preserved. The algorithm `stable_partition` does preserve this original ordering. +Elements *`a`* and *`b`* are equivalent, but not necessarily equal, if both `pred( a, b )` is false and `pred( b, a )` is false, where *`pred`* is the parameter-specified predicate. The `partition` algorithm is not stable and does not guarantee that the relative ordering of equivalent elements will be preserved. The algorithm `stable_partition` does preserve this original ordering. -The complexity is linear: there are `(last - first)` applications of *pred* and at most `(last - first)/2` swaps. +The complexity is linear: there are `(last - first)` applications of *`pred`* and at most `(last - first)/2` swaps. ### Example @@ -5687,7 +5687,7 @@ int main() } ``` -## partition_copy +## `partition_copy` Copies elements for which a condition is **`true`** to one destination, and for which the condition is **`false`** to another. The elements must come from a specified range. @@ -5712,29 +5712,29 @@ pair partition_copy( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator that indicates the beginning of a range to check for a condition. -*last*\ +*`last`*\ An input iterator that indicates the end of a range. -*dest1*\ +*`dest1`*\ An output iterator used to copy elements that return true for a condition tested by using *pred*. -*dest2*\ +*`dest2`*\ An output iterator used to copy elements that return false for a condition tested by using *pred*. -*pred*\ +*`pred`*\ The condition to test for. This is provided by a user-defined predicate function object that defines the condition to be tested. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Remarks The template function copies each element `X` in `[first,last)` to `*dest1++` if `pred(X)` is true, or to `*dest2++` if not. It returns `pair(dest1, dest2)`. -## partition_point +## `partition_point` Returns the first element in the given range that does not satisfy the condition. The elements are sorted so that those that satisfy the condition come before those that do not. @@ -5748,13 +5748,13 @@ ForwardIterator partition_point( ### Parameters -*first*\ +*`first`*\ A `ForwardIterator` that indicates the start of a range to check for a condition. -*last*\ +*`last`*\ A `ForwardIterator` that indicates the end of a range. -*pred*\ +*`pred`*\ The condition to test for. This is provided by a user-defined predicate function object that defines the condition to be satisfied by the element being searched for. A unary predicate takes a single argument and returns **`true`** or **`false`**. ### Return value @@ -5763,9 +5763,9 @@ Returns a `ForwardIterator` that refers to the first element that does not fulfi ### Remarks -The template function finds the first iterator `it` in `[first, last)` for which `pred(*it)` is **`false`**. The sequence must be ordered by *pred*. +The template function finds the first iterator `it` in `[first, last)` for which `pred(*it)` is **`false`**. The sequence must be ordered by *`pred`*. -## pop_heap +## `pop_heap` Removes the largest element from the front of a heap to the next-to-last position in the range and then forms a new heap from the remaining elements. @@ -5784,13 +5784,13 @@ void pop_heap( ### Parameters -*first*\ +*`first`*\ A random-access iterator addressing the position of the first element in the heap. -*last*\ +*`last`*\ A random-access iterator addressing the position one past the final element in the heap. -*pred*\ +*`pred`*\ User-defined predicate function object that defines sense in which one element is less than another. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Remarks @@ -5874,7 +5874,7 @@ int main() } ``` -## prev_permutation +## `prev_permutation` Reorders the elements in a range so that the original ordering is replaced by the lexicographically previous greater permutation if it exists, where the sense of previous may be specified with a binary predicate. @@ -5893,13 +5893,13 @@ bool prev_permutation( ### Parameters -*first*\ +*`first`*\ A bidirectional iterator pointing to the position of the first element in the range to be permuted. -*last*\ +*`last`*\ A bidirectional iterator pointing to the position one past the final element in the range to be permuted. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the comparison criterion to be satisfied by successive elements in the ordering. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -6049,7 +6049,7 @@ After another prev_permutation of vector v1, v1 = ( -3 -2 0 2 -1 1 3 ). ``` -## push_heap +## `push_heap` Adds an element that is at the end of a range to an existing heap consisting of the prior elements in the range. @@ -6068,13 +6068,13 @@ void push_heap( ### Parameters -*first*\ +*`first`*\ A random-access iterator addressing the position of the first element in the heap. -*last*\ +*`last`*\ A random-access iterator addressing the position one past the final element in the range to be converted into a heap. -*pred*\ +*`pred`*\ User-defined predicate function object that defines sense in which one element is less than another. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Remarks @@ -6162,11 +6162,11 @@ int main() { } ``` -## random_shuffle +## `random_shuffle` -The std::random_shuffle() function is deprecated, replaced by [std::shuffle](algorithm-functions.md#shuffle). For a code example and more information, see [\](random.md) and the Stack Overflow post [Why are std::random_shuffle methods being deprecated in C++14?](https://go.microsoft.com/fwlink/p/?linkid=397954). +The `std::random_shuffle()` function is deprecated, replaced by [`std::shuffle`](algorithm-functions.md#shuffle). For a code example and more information, see [``](random.md) and the Stack Overflow post [Why are `std::random_shuffle` methods being deprecated in C++14?](https://go.microsoft.com/fwlink/p/?linkid=397954). -## remove +## `remove` Eliminates a specified value from a given range without disturbing the order of the remaining elements and returning the end of a new range free of the specified value. @@ -6187,16 +6187,16 @@ ForwardIterator remove( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range from which elements are being removed. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range from which elements are being removed. -*value*\ +*`value`*\ The value that is to be removed from the range. ### Return value @@ -6213,7 +6213,7 @@ The `operator==` used to determine the equality between elements must impose an The complexity is linear; there are (`last` - `first`) comparisons for equality. -The [list class](list-class.md) has a more efficient member function version of `remove`, which also relinks pointers. +The [`list` class](list-class.md) has a more efficient member function version of `remove`, which also relinks pointers. ### Example @@ -6262,7 +6262,7 @@ int main() } ``` -## remove_copy +## `remove_copy` Copies elements from a source range to a destination range, except that elements of a specified value are not copied, without disturbing the order of the remaining elements and returning the end of a new destination range. @@ -6285,19 +6285,19 @@ ForwardIterator2 remove_copy( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range from which elements are being removed. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range from which elements are being removed. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range to which elements are being removed. -*value*\ +*`value`*\ The value that is to be removed from the range. ### Return value @@ -6360,7 +6360,7 @@ int main() } ``` -## remove_copy_if +## `remove_copy_if` Copies elements from a source range to a destination range, except for elements that satisfy a predicate. Elements are copied without disturbing the order of the remaining elements. Returns the end of a new destination range. @@ -6383,19 +6383,19 @@ ForwardIterator2 remove_copy_if( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator addressing the position of the first element in the range from which elements are being removed. -*last*\ +*`last`*\ An input iterator addressing the position one past the final element in the range from which elements are being removed. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range to which elements are being removed. -*pred*\ +*`pred`*\ The unary predicate that must be satisfied is the value of an element is to be replaced. ### Return value @@ -6467,7 +6467,7 @@ int main() } ``` -## remove_if +## `remove_if` Eliminates elements that satisfy a predicate from a given range without disturbing the order of the remaining elements and returning the end of a new range free of the specified value. @@ -6488,16 +6488,16 @@ ForwardIterator remove_if( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator pointing to the position of the first element in the range from which elements are being removed. -*last*\ +*`last`*\ A forward iterator pointing to the position one past the final element in the range from which elements are being removed. -*pred*\ +*`pred`*\ The unary predicate that must be satisfied is the value of an element is to be replaced. ### Return value @@ -6568,7 +6568,7 @@ int main() } ``` -## replace +## `replace` Examines each element in a range and replaces it if it matches a specified value. @@ -6591,19 +6591,19 @@ void replace( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator pointing to the position of the first element in the range from which elements are being replaced. -*last*\ +*`last`*\ A forward iterator pointing to the position one past the final element in the range from which elements are being replaced. -*oldVal*\ +*`oldVal`*\ The old value of the elements being replaced. -*newVal*\ +*`newVal`*\ The new value being assigned to the elements with the old value. ### Remarks @@ -6655,7 +6655,7 @@ int main() } ``` -## replace_copy +## `replace_copy` Examines each element in a source range and replaces it if it matches a specified value while copying the result into a new destination range. @@ -6680,22 +6680,22 @@ ForwardIterator2 replace_copy( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator pointing to the position of the first element in the range from which elements are being replaced. -*last*\ +*`last`*\ An input iterator pointing to the position one past the final element in the range from which elements are being replaced. -*result*\ +*`result`*\ An output iterator pointing to the first element in the destination range to where the altered sequence of elements is being copied. -*oldVal*\ +*`oldVal`*\ The old value of the elements being replaced. -*newVal*\ +*`newVal`*\ The new value being assigned to the elements with the old value. ### Return value @@ -6770,7 +6770,7 @@ int main() } ``` -## replace_copy_if +## `replace_copy_if` Examines each element in a source range and replaces it if it satisfies a specified predicate while copying the result into a new destination range. @@ -6795,22 +6795,22 @@ ForwardIterator2 replace_copy_if( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ An input iterator pointing to the position of the first element in the range from which elements are being replaced. -*last*\ +*`last`*\ An input iterator pointing to the position one past the final element in the range from which elements are being replaced. -*result*\ +*`result`*\ An output iterator pointing to the position of the first element in the destination range to which elements are being copied. -*pred*\ +*`pred`*\ The unary predicate that must be satisfied is the value of an element is to be replaced. -*value*\ +*`value`*\ The new value being assigned to the elements whose old value satisfies the predicate. ### Return value @@ -6893,7 +6893,7 @@ int main() } ``` -## replace_if +## `replace_if` Examines each element in a range and replaces it if it satisfies a specified predicate. @@ -6916,19 +6916,19 @@ void replace_if( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator pointing to the position of the first element in the range from which elements are being replaced. -*last*\ +*`last`*\ An iterator pointing to the position one past the final element in the range from which elements are being replaced. -*pred*\ +*`pred`*\ The unary predicate that must be satisfied is the value of an element is to be replaced. -*value*\ +*`value`*\ The new value being assigned to the elements whose old value satisfies the predicate. ### Remarks @@ -6989,7 +6989,7 @@ int main() } ``` -## reverse +## `reverse` Reverses the order of the elements within a range. @@ -7008,13 +7008,13 @@ void reverse( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A bidirectional iterator pointing to the position of the first element in the range within which the elements are being permuted. -*last*\ +*`last`*\ A bidirectional iterator pointing to the position one past the final element in the range within which the elements are being permuted. ### Remarks @@ -7064,7 +7064,7 @@ The modified vector v1 with values reversed is: ( 9 8 7 6 5 4 3 2 1 0 ). ``` -## reverse_copy +## `reverse_copy` Reverses the order of the elements within a source range while copying them into a destination range @@ -7085,16 +7085,16 @@ ForwardIterator reverse_copy( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A bidirectional iterator pointing to the position of the first element in the source range within which the elements are being permuted. -*last*\ +*`last`*\ A bidirectional iterator pointing to the position one past the final element in the source range within which the elements are being permuted. -*result*\ +*`result`*\ An output iterator pointing to the position of the first element in the destination range to which elements are being copied. ### Return value @@ -7146,7 +7146,7 @@ int main() } ``` -## rotate +## `rotate` Exchanges the elements in two adjacent ranges. @@ -7167,16 +7167,16 @@ ForwardIterator rotate( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be rotated. -*middle*\ +*`middle`*\ A forward iterator defining the boundary within the range that addresses the position of the first element in the second part of the range whose elements are to be exchanged with those in the first part of the range. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be rotated. ### Remarks @@ -7260,7 +7260,7 @@ After the rotation of a single deque element to the back, d1 is ( 0 1 2 3 4 5 ). ``` -## rotate_copy +## `rotate_copy` Exchanges the elements in two adjacent ranges within a source range and copies the result to a destination range. @@ -7283,19 +7283,19 @@ ForwardIterator2 rotate_copy( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be rotated. -*middle*\ +*`middle`*\ A forward iterator defining the boundary within the range that addresses the position of the first element in the second part of the range whose elements are to be exchanged with those in the first part of the range. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be rotated. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range. ### Return value @@ -7368,7 +7368,7 @@ int main() } ``` -## sample +## `sample` ```cpp template @@ -7380,7 +7380,7 @@ SampleIterator sample( UniformRandomBitGenerator&& g); ``` -## search +## `search` Searches for the first occurrence of a sequence within a target range whose elements are equal to those in a given sequence of elements or whose elements are equivalent in a sense specified by a binary predicate to the elements in the given sequence. @@ -7426,26 +7426,26 @@ ForwardIterator search( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last1*\ +*`last1`*\ A forward iterator addressing the position one past the final element in the range to be searched. -*first2*\ +*`first2`*\ A forward iterator addressing the position of the first element in the range to be matched. -*last2*\ +*`last2`*\ A forward iterator addressing the position one past the final element in the range to be matched. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. -*searcher*\ -The searcher that encapsulates the pattern to look for and the search algorithm to use. For more information on searchers, see [default_searcher class](default-searcher-class.md), [boyer_moore_horspool_searcher class](boyer-moore-horspool-searcher-class.md), and [boyer_moore_searcher class](boyer-moore-searcher-class.md). +*`searcher`*\ +The searcher that encapsulates the pattern to look for and the search algorithm to use. For more information on searchers, see [`default_searcher` class](default-searcher-class.md), [`boyer_moore_horspool_searcher` class](boyer-moore-horspool-searcher-class.md), and [`boyer_moore_searcher` class](boyer-moore-searcher-class.md). ### Return value @@ -7558,7 +7558,7 @@ to those in v2 under the binary predicate twice and the first one begins at position 2. ``` -## search_n +## `search_n` Searches for the first subsequence in a range that of a specified number of elements having a particular value or a relation to that value as specified by a binary predicate. @@ -7598,22 +7598,22 @@ ForwardIterator search_n( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ A forward iterator addressing the position of the first element in the range to be searched. -*last1*\ +*`last1`*\ A forward iterator addressing the position one past the final element in the range to be searched. -*count*\ +*`count`*\ The size of the subsequence being searched for. -*value*\ +*`value`*\ The value of the elements in the sequence being searched for. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -7711,7 +7711,7 @@ There is a match of a sequence ( 5 5 5 ) under the equivalence predicate one_half in v1 and the first one begins at position 15. ``` -## set_difference +## `set_difference` Unites all of the elements that belong to one sorted source range, but not to a second sorted source range, into a single, sorted destination range, where the ordering criterion may be specified by a binary predicate. @@ -7755,25 +7755,25 @@ ForwardIterator set_difference( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first of two sorted source ranges to be united and sorted into a single range representing the difference of the two source ranges. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first of two sorted source ranges to be united and sorted into a single range representing the difference of the two source ranges. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the difference of the two source ranges. -*last2*\ +*`last2`*\ An input iterator addressing the position one past the last element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the difference of the two source ranges. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range where the two source ranges are to be united into a single sorted range representing the difference of the two source ranges. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The binary predicate takes two arguments and should return **`true`** when the first element is less than the second element and **`false`** otherwise. ### Return value @@ -7913,7 +7913,7 @@ int main() } ``` -## set_intersection +## `set_intersection` Unites all of the elements that belong to both sorted source ranges into a single, sorted destination range, where the ordering criterion may be specified by a binary predicate. @@ -7957,25 +7957,25 @@ ForwardIterator set_intersection( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first of two sorted source ranges to be united and sorted into a single range representing the intersection of the two source ranges. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first of two sorted source ranges to be united and sorted into a single range representing the intersection of the two source ranges. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the intersection of the two source ranges. -*last2*\ +*`last2`*\ An input iterator addressing the position one past the last element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the intersection of the two source ranges. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range where the two source ranges are to be united into a single sorted range representing the intersection of the two source ranges. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The binary predicate takes two arguments and should return **`true`** when the first element is less than the second element and **`false`** otherwise. ### Return value @@ -8111,7 +8111,7 @@ int main() } ``` -## set_symmetric_difference +## `set_symmetric_difference` Unites all of the elements that belong to one, but not both, of the sorted source ranges into a single, sorted destination range, where the ordering criterion may be specified by a binary predicate. @@ -8155,25 +8155,25 @@ ForwardIterator set_symmetric_difference( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first of two sorted source ranges to be united and sorted into a single range representing the symmetric difference of the two source ranges. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first of two sorted source ranges to be united and sorted into a single range representing the symmetric difference of the two source ranges. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the symmetric difference of the two source ranges. -*last2*\ +*`last2`*\ An input iterator addressing the position one past the last element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the symmetric difference of the two source ranges. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range where the two source ranges are to be united into a single sorted range representing the symmetric difference of the two source ranges. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The binary predicate takes two arguments and should return **`true`** when the first element is less than the second element and **`false`** otherwise. ### Return value @@ -8313,7 +8313,7 @@ int main() } ``` -## set_union +## `set_union` Unites all of the elements that belong to at least one of two sorted source ranges into a single, sorted destination range, where the ordering criterion may be specified by a binary predicate. @@ -8357,25 +8357,25 @@ ForwardIterator set_union( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first of two sorted source ranges to be united and sorted into a single range representing the union of the two source ranges. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the last element in the first of two sorted source ranges to be united and sorted into a single range representing the union of the two source ranges. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the union of the two source ranges. -*last2*\ +*`last2`*\ An input iterator addressing the position one past the last element in second of two consecutive sorted source ranges to be united and sorted into a single range representing the union of the two source ranges. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range where the two source ranges are to be united into a single sorted range representing the union of the two source ranges. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. The binary predicate takes two arguments and should return **`true`** when the first element is less than the second element and **`false`** otherwise. ### Return value @@ -8515,7 +8515,7 @@ int main() } ``` -## shuffle +## `shuffle` Shuffles (rearranges) elements for a given range by using a random number generator. @@ -8529,20 +8529,20 @@ void shuffle( ### Parameters -*first*\ +*`first`*\ An iterator to the first element in the range to be shuffled, inclusive. Must meet the requirements of `RandomAccessIterator` and `ValueSwappable`. -*last*\ +*`last`*\ An iterator to the last element in the range to be shuffled, exclusive. Must meet the requirements of `RandomAccessIterator` and `ValueSwappable`. -*gen*\ +*`gen`*\ The random number generator that the `shuffle()` function will use for the operation. Must meet the requirements of a `UniformRandomNumberGenerator`. ### Remarks -For more information, and a code sample that uses `shuffle()`, see [\](random.md). +For more information, and a code sample that uses `shuffle()`, see [``](random.md). -## sort +## `sort` Arranges the elements in a specified range into a nondescending order or according to an ordering criterion specified by a binary predicate. @@ -8574,16 +8574,16 @@ void sort( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A random-access iterator addressing the position of the first element in the range to be sorted. -*last*\ +*`last`*\ A random-access iterator addressing the position one past the final element in the range to be sorted. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the comparison criterion to be satisfied by successive elements in the ordering. This binary predicate takes two arguments and returns **`true`** if the two arguments are in order and **`false`** otherwise. This comparator function must impose a strict weak ordering on pairs of elements from the sequence. For more information, see [Algorithms](algorithms.md). ### Remarks @@ -8662,7 +8662,7 @@ Resorted (greater) vector v1 = ( 11 10 9 8 7 6 5 4 3 2 1 0 ) Resorted (UDgreater) vector v1 = ( 11 10 9 8 7 6 5 4 3 2 1 0 ) ``` -## sort_heap +## `sort_heap` Converts a heap into a sorted range. @@ -8681,13 +8681,13 @@ void sort_heap( ### Parameters -*first*\ +*`first`*\ A random-access iterator addressing the position of the first element in the target heap. -*last*\ +*`last`*\ A random-access iterator addressing the position one past the final element in the target heap. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the sense in which one element is less than another. A comparison predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Remarks @@ -8702,7 +8702,7 @@ After the application if this algorithm, the range it was applied to is no longe This is not a stable sort because the relative order of equivalent elements is not necessarily preserved. -Heaps are an ideal way to implement priority queues and they are used in the implementation of the C++ Standard Library container adaptor [priority_queue Class](priority-queue-class.md). +Heaps are an ideal way to implement priority queues and they are used in the implementation of the C++ Standard Library container adaptor [`priority_queue` Class](priority-queue-class.md). The range referenced must be valid; all pointers must be dereferenceable and within the sequence the last position is reachable from the first by incrementation. @@ -8762,7 +8762,7 @@ int main() } ``` -## stable_partition +## `stable_partition` Classifies elements in a range into two disjoint sets, with those elements satisfying a unary predicate preceding those that fail to satisfy it, preserving the relative order of equivalent elements. @@ -8783,16 +8783,16 @@ BidirectionalIterator stable_partition( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A bidirectional iterator addressing the position of the first element in the range to be partitioned. -*last*\ +*`last`*\ A bidirectional iterator addressing the position one past the final element in the range to be partitioned. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if an element is to be classified. A unary predicate takes a single argument and returns **`true`** if satisfied, or **`false`** if not satisfied. ### Return value @@ -8803,7 +8803,7 @@ A bidirectional iterator addressing the position of the first element in the ran The range referenced must be valid; all pointers must be dereferenceable and within the sequence the last position is reachable from the first by incrementation. -Elements *a* and *b* are equivalent, but not necessarily equal, if both `pred( a, b )` is false and `pred( b, a )` is false, where *pred* is the parameter-specified predicate. The `stable_partition` algorithm is stable and guarantees that the relative ordering of equivalent elements will be preserved. The algorithm `partition` does not necessarily preserve this original ordering. +Elements *a* and *b* are equivalent, but not necessarily equal, if both `pred( a, b )` is false and `pred( b, a )` is false, where *`pred`* is the parameter-specified predicate. The `stable_partition` algorithm is stable and guarantees that the relative ordering of equivalent elements will be preserved. The algorithm `partition` does not necessarily preserve this original ordering. ### Example @@ -8852,7 +8852,7 @@ int main() } ``` -## stable_sort +## `stable_sort` Arranges the elements in a specified range into a nondescending order or according to an ordering criterion specified by a binary predicate and preserves the relative ordering of equivalent elements. @@ -8884,16 +8884,16 @@ void stable_sort( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A bidirectional iterator addressing the position of the first element in the range to be sorted. -*last*\ +*`last`*\ A bidirectional iterator addressing the position one past the final element in the range to be sorted. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the comparison criterion to be satisfied by successive elements in the ordering. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Remarks @@ -8971,7 +8971,7 @@ Resorted (greater) vector v1 = ( 10 10 8 8 6 6 4 4 2 2 0 0 ) Resorted (UDgreater) vector v1 = ( 10 10 8 8 6 6 4 4 2 2 0 0 ) ``` -## swap +## `swap` The first override exchanges the values of two objects. The second override exchanges the values between two arrays of objects. @@ -8988,10 +8988,10 @@ void swap( ### Parameters -*left*\ +*`left`*\ For the first override, the first object to have its contents exchanged. For the second override, the first array of objects to have its contents exchanged. -*right*\ +*`right`*\ For the first override, the second object to have its contents exchanged. For the second override, the second array of objects to have its contents exchanged. ### Remarks @@ -9054,7 +9054,7 @@ Vector v1 is ( 5 5 5 5 5 ). Vector v2 is ( 0 1 2 3 4 5 6 7 8 9 10 ). ``` -## swap_ranges +## `swap_ranges` Exchanges the elements of one range with the elements of another, equal sized range. @@ -9075,16 +9075,16 @@ ForwardIterator2 swap_ranges( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ A forward iterator pointing to the first position of the first range whose elements are to be exchanged. -*last1*\ +*`last1`*\ A forward iterator pointing to one past the final position of the first range whose elements are to be exchanged. -*first2*\ +*`first2`*\ A forward iterator pointing to the first position of the second range whose elements are to be exchanged. ### Return value @@ -9158,7 +9158,7 @@ After the swap_range, vector v1 is ( 6 6 6 6 6 6 ). After the swap_range deque d1 is ( 0 1 2 3 4 5 ). ``` -## transform +## `transform` Applies a specified function object to each element in a source range or to a pair of elements from two source ranges and copies the return values of the function object into a destination range. @@ -9198,22 +9198,22 @@ ForwardIterator transform( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first1*\ +*`first1`*\ An input iterator addressing the position of the first element in the first source range to be operated on. -*last1*\ +*`last1`*\ An input iterator addressing the position one past the final element in the first source range operated on. -*first2*\ +*`first2`*\ An input iterator addressing the position of the first element in the second source range to be operated on. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range. -*func*\ +*`func`*\ User-defined unary function object used in the first version of the algorithm that is applied to each element in the first source range or A user-defined (UD) binary function object used in the second version of the algorithm that is applied pairwise, in a forward order, to the two source ranges. ### Return value @@ -9224,7 +9224,7 @@ An output iterator addressing the position one past the final element in the des The ranges referenced must be valid; all pointers must be dereferenceable and within each sequence the last position must be reachable from the first by incrementation. The destination range must be large enough to contain the transformed source range. -If *result* is set equal to *first1* in the first version of the algorithm, then the source and destination ranges will be the same and the sequence will be modified in place. But the *result* may not address a position within the range [`first1` + 1, `last1`). +If *result* is set equal to *`first1`* in the first version of the algorithm, then the source and destination ranges will be the same and the sequence will be modified in place. But the *`result`* may not address a position within the range [`first1` + 1, `last1`). The complexity is linear with at most (`last1` - `first1`) comparisons. @@ -9314,7 +9314,7 @@ Multiplying elements of the vectors v1mod and v2 pairwise gives: v3 = ( 320 180 80 20 0 20 80 ). ``` -## unique +## `unique` Removes duplicate elements that are adjacent to each other in a specified range. @@ -9346,16 +9346,16 @@ ForwardIterator unique( ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the range to be scanned for duplicate removal. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the range to be scanned for duplicate removal. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -9463,7 +9463,7 @@ Removing adjacent elements satisfying the binary predicate mod_equal from vector v1 gives ( 5 7 ). ``` -## unique_copy +## `unique_copy` Copies elements from a source range into a destination range except for the duplicate elements that are adjacent to each other. @@ -9499,19 +9499,19 @@ ForwardIterator2 unique_copy(ExecutionPolicy&& exec, ### Parameters -*exec*\ +*`exec`*\ The execution policy to use. -*first*\ +*`first`*\ A forward iterator addressing the position of the first element in the source range to be copied. -*last*\ +*`last`*\ A forward iterator addressing the position one past the final element in the source range to be copied. -*result*\ +*`result`*\ An output iterator addressing the position of the first element in the destination range that is receiving the copy with consecutive duplicates removed. -*pred*\ +*`pred`*\ User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value @@ -9600,7 +9600,7 @@ int main() { } ``` -## upper_bound +## `upper_bound` Finds the position of the first element in an ordered range that has a value that is greater than a specified value, where the ordering criterion may be specified by a binary predicate. @@ -9621,16 +9621,16 @@ ForwardIterator upper_bound( ### Parameters -*first*\ +*`first`*\ The position of the first element in the range to be searched. -*last*\ +*`last`*\ The position one past the final element in the range to be searched. -*value*\ +*`value`*\ The value in the ordered range that needs to be exceeded by the value of the element addressed by the iterator returned. -*pred*\ +*`pred`*\ User-defined comparison predicate function object that defines the sense in which one element is less than another. A comparison predicate takes two arguments and returns **`true`** when satisfied and **`false`** when not satisfied. ### Return value diff --git a/docs/standard-library/basic-string-class.md b/docs/standard-library/basic-string-class.md index 7b762c28677..69cf74ad7dc 100644 --- a/docs/standard-library/basic-string-class.md +++ b/docs/standard-library/basic-string-class.md @@ -3916,7 +3916,7 @@ An iterator, const_pointer, or const_iterator addressing the first character to An iterator, const_pointer, or const_iterator addressing the last character to be copied in the parameter string. *`count`*\ -The number of times *char_value* is copied into the operand string. +The number of times *`char_value`* is copied into the operand string. ### Return value diff --git a/docs/standard-library/cpp-standard-library-header-files.md b/docs/standard-library/cpp-standard-library-header-files.md index cf0a53ed2ae..42ef673a990 100644 --- a/docs/standard-library/cpp-standard-library-header-files.md +++ b/docs/standard-library/cpp-standard-library-header-files.md @@ -15,29 +15,29 @@ Header files for the C++ standard library and extensions, by category. | Category | Headers | | - | - | -| [Algorithms](./algorithms.md) | [\](algorithm.md), [\](cstdlib.md), [\](numeric.md) | -| Atomic operations | [\](atomic.md)11 | -| C library wrappers | [\](cassert.md), [\](ccomplex.md)11 a b, [\](cctype.md), [\](cerrno.md), [\](cfenv.md)11, [\](cfloat.md), [\](cinttypes.md)11, [\](ciso646.md)b, [\](climits.md), [\](clocale.md), [\](cmath.md), [\](csetjmp.md), [\](csignal.md), [\](cstdalign.md)11 a b, [\](cstdarg.md), [\](cstdbool.md)11 a b, [\](cstddef.md), [\](cstdint.md)11, [\](cstdio.md), [\](cstdlib.md), [\](cstring.md), [\](ctgmath.md)11 a b, [\](ctime.md), [\](cuchar.md)11, [\](cwchar.md), [\](cwctype.md) | -| Concepts | \20 | +| [Algorithms](./algorithms.md) | [``](algorithm.md), [``](cstdlib.md), [``](numeric.md) | +| Atomic operations | [``](atomic.md)11 | +| C library wrappers | [``](cassert.md), [``](ccomplex.md)11 a b, [``](cctype.md), [``](cerrno.md), [``](cfenv.md)11, [``](cfloat.md), [``](cinttypes.md)11, [``](ciso646.md)b, [``](climits.md), [``](clocale.md), [``](cmath.md), [``](csetjmp.md), [``](csignal.md), [``](cstdalign.md)11 a b, [``](cstdarg.md), [``](cstdbool.md)11 a b, [``](cstddef.md), [``](cstdint.md)11, [``](cstdio.md), [``](cstdlib.md), [``](cstring.md), [``](ctgmath.md)11 a b, [``](ctime.md), [``](cuchar.md)11, [``](cwchar.md), [``](cwctype.md) | +| Concepts | ``20 | | [Containers](./stl-containers.md) | | -| Sequence containers | [\](array.md)11, [\](deque.md), [\](forward-list.md)11, [\](list.md), [\](vector.md) | -| Ordered associative containers| [\](map.md), [\](set.md) | -| Unordered associative containers | [\](unordered-map.md)11, [\](unordered-set.md)11 | -| Container adaptors | [\](queue.md), [\](stack.md) | -| Container views | [\](span.md)20 | -| [Errors and exception handling](../cpp/errors-and-exception-handling-modern-cpp.md) | [\](cassert.md), [\](exception.md), [\](stdexcept.md), [\](system-error.md)11 | -| General utilities | \17, [\](bit.md)20, [\](bitset.md), [\](cstdlib.md), \17, [\](functional.md), [\](memory.md), \17, \17, [\](ratio.md)11, [\](scoped-allocator.md)11, [\](tuple.md)11, [\](type-traits.md)11, [\](typeindex.md)11, [\](utility.md), \17 | -| [I/O and formatting](../text/string-and-i-o-formatting-modern-cpp.md) | [\](cinttypes.md)11, [\](cstdio.md), [\](filesystem.md)17, [\](fstream.md), [\](iomanip.md), [\](ios.md), [\](iosfwd.md), [\](iostream.md), [\](istream.md), [\](ostream.md), [\](sstream.md), [\](streambuf.md), [\](strstream.md)c, \20 | -| Iterators | [\](iterator.md) | -| Language support | [\](cfloat.md), [\](climits.md), [\](codecvt.md)11 a, \20, \20, \20, [\](csetjmp.md), [\](csignal.md), [\](cstdarg.md), [\](cstddef.md), [\](cstdint.md)11, [\](cstdlib.md), [\](exception.md), [\](initializer-list.md)11, [\](limits.md), [\](new.md), [\](typeinfo.md), \20 | -| Localization | [\](clocale.md), [\](codecvt.md)11 a, [\](cvt-wbuffer.md), [\](cvt-wstring.md), [\](locale.md) | -| Math and numerics | \20, [\](cfenv.md)11, [\](cmath.md), [\](complex.md), [\](cstdlib.md), [\](limits.md), [\](numeric.md), [\](random.md)11, [\](ratio.md)11, [\](valarray.md) | -| [Memory management](../cpp/smart-pointers-modern-cpp.md) | [\](allocators-header.md), [\](memory.md), \17, [\](new.md), [\](scoped-allocator.md)11 | -| Multithreading | [\](atomic.md)11, [\](condition-variable.md)11, [\](future.md)11, [\](mutex.md)11, [\](shared-mutex.md)14, [\](thread.md)11 | -| Ranges | \20 | -| Regular expressions | [\](regex.md)11 | -| Strings and character data | [\](charconv.md)17, [\](cctype.md), [\](cstdlib.md), [\](cstring.md), [\](cuchar.md)11, [\](cwchar.md), [\](cwctype.md), [\](regex.md)11, [\](string.md), [\](string-view.md)17 | -| Time | [\](chrono.md)11, [\](ctime.md) | +| Sequence containers | [``](array.md)11, [``](deque.md), [``](forward-list.md)11, [``](list.md), [``](vector.md) | +| Ordered associative containers| [``](map.md), [``](set.md) | +| Unordered associative containers | [``](unordered-map.md)11, [``](unordered-set.md)11 | +| Container adaptors | [``](queue.md), [``](stack.md) | +| Container views | [``](span.md)20 | +| [Errors and exception handling](../cpp/errors-and-exception-handling-modern-cpp.md) | [``](cassert.md), [``](exception.md), [``](stdexcept.md), [``](system-error.md)11 | +| General utilities | ``17, [``](bit.md)20, [``](bitset.md), [``](cstdlib.md), ``17, [``](functional.md), [``](memory.md), ``17, ``17, [``](ratio.md)11, [``](scoped-allocator.md)11, [``](tuple.md)11, [``](type-traits.md)11, [``](typeindex.md)11, [``](utility.md), ``17 | +| [I/O and formatting](../text/string-and-i-o-formatting-modern-cpp.md) | [``](cinttypes.md)11, [``](cstdio.md), [``](filesystem.md)17, [``](fstream.md), [``](iomanip.md), [``](ios.md), [``](iosfwd.md), [``](iostream.md), [``](istream.md), [``](ostream.md), [``](sstream.md), [``](streambuf.md), [``](strstream.md)c, ``20 | +| Iterators | [``](iterator.md) | +| Language support | [``](cfloat.md), [``](climits.md), [``](codecvt.md)11 a, ``20, ``20, ``20, [``](csetjmp.md), [``](csignal.md), [``](cstdarg.md), [``](cstddef.md), [``](cstdint.md)11, [``](cstdlib.md), [``](exception.md), [``](initializer-list.md)11, [``](limits.md), [``](new.md), [``](typeinfo.md), ``20 | +| Localization | [``](clocale.md), [``](codecvt.md)11 a, [``](cvt-wbuffer.md), [``](cvt-wstring.md), [``](locale.md) | +| Math and numerics | ``20, [``](cfenv.md)11, [``](cmath.md), [``](complex.md), [``](cstdlib.md), [``](limits.md), [``](numeric.md), [``](random.md)11, [``](ratio.md)11, [``](valarray.md) | +| [Memory management](../cpp/smart-pointers-modern-cpp.md) | [``](allocators-header.md), [``](memory.md), ``17, [``](new.md), [``](scoped-allocator.md)11 | +| Multithreading | [``](atomic.md)11, [``](condition-variable.md)11, [``](future.md)11, [``](mutex.md)11, [``](shared-mutex.md)14, [``](thread.md)11 | +| Ranges | ``20 | +| Regular expressions | [``](regex.md)11 | +| Strings and character data | [``](charconv.md)17, [``](cctype.md), [``](cstdlib.md), [``](cstring.md), [``](cuchar.md)11, [``](cwchar.md), [``](cwctype.md), [``](regex.md)11, [``](string.md), [``](string-view.md)17 | +| Time | [``](chrono.md)11, [``](ctime.md) | 11 Added in the C++11 standard.\ 14 Added in the C++14 standard.\ @@ -53,22 +53,22 @@ Header files for the C++ standard library and extensions, by category. |Category|Headers| |-|-| -|[Algorithms](./algorithms.md)|[\](algorithm.md)| -|C library wrappers|[\](cassert.md), [\](cctype.md), [\](cerrno.md), [\](cfenv.md), [\](cfloat.md), [\](cinttypes.md), [\](ciso646.md), [\](climits.md), [\](clocale.md), [\](cmath.md), [\](csetjmp.md), [\](csignal.md), [\](cstdarg.md), [\](cstdbool.md), [\](cstddef.md), [\](cstdint.md), [\](cstdio.md), [\](cstdlib.md), [\](cstring.md), [\](ctgmath.md), [\](ctime.md), [\](cwchar.md), [\](cwctype.md)| +|[Algorithms](./algorithms.md)|[``](algorithm.md)| +|C library wrappers|[``](cassert.md), [``](cctype.md), [``](cerrno.md), [``](cfenv.md), [``](cfloat.md), [``](cinttypes.md), [``](ciso646.md), [``](climits.md), [``](clocale.md), [``](cmath.md), [``](csetjmp.md), [``](csignal.md), [``](cstdarg.md), [``](cstdbool.md), [``](cstddef.md), [``](cstdint.md), [``](cstdio.md), [``](cstdlib.md), [``](cstring.md), [``](ctgmath.md), [``](ctime.md), [``](cwchar.md), [``](cwctype.md)| |[Containers](./stl-containers.md)|| -|Sequence containers|[\](array.md), [\](deque.md), [\](forward-list.md), [\](list.md), [\](vector.md)| -|Ordered associative containers| [\](map.md), [\](set.md)| -|Unordered associative containers|[\](unordered-map.md), [\](unordered-set.md)| -|Adaptor containers|[\](queue.md), [\](stack.md)| -|[Errors and exception handling](../cpp/errors-and-exception-handling-modern-cpp.md)|[\](exception.md), [\](stdexcept.md), [\](system-error.md)| -|[I/O and formatting](../text/string-and-i-o-formatting-modern-cpp.md)|[\](filesystem.md), [\](fstream.md), [\](iomanip.md), [\](ios.md), [\](iosfwd.md), [\](iostream.md), [\](istream.md), [\](ostream.md), [\](sstream.md), [\](streambuf.md), [\](strstream.md)| -|Iterators|[\](iterator.md)| -|Localization|[\](codecvt.md), [\](cvt-wbuffer.md), [\](cvt-wstring.md), [\](locale.md)| -|Math and numerics|[\](complex.md), [\](limits.md), [\](numeric.md), [\](random.md), [\](ratio.md), [\](valarray.md)| -|[Memory Management](../cpp/smart-pointers-modern-cpp.md)|[\](allocators-header.md), [\](memory.md), [\](new.md), [\](scoped-allocator.md)| -|Multithreading|[\](atomic.md), [\](condition-variable.md), [\](future.md), [\](mutex.md), [\](shared-mutex.md), [\](thread.md)| -|Other utilities|[\](bitset.md), [\](chrono.md), [\](functional.md), [\](initializer-list.md), [\](tuple.md), [\](type-traits.md), [\](typeinfo.md), [\](typeindex.md), [\](utility.md)| -|Strings and character data|[\](regex.md), [\](string.md), [\](string-view.md) +|Sequence containers|[``](array.md), [``](deque.md), [``](forward-list.md), [``](list.md), [``](vector.md)| +|Ordered associative containers| [``](map.md), [``](set.md)| +|Unordered associative containers|[``](unordered-map.md), [``](unordered-set.md)| +|Adaptor containers|[``](queue.md), [``](stack.md)| +|[Errors and exception handling](../cpp/errors-and-exception-handling-modern-cpp.md)|[``](exception.md), [``](stdexcept.md), [``](system-error.md)| +|[I/O and formatting](../text/string-and-i-o-formatting-modern-cpp.md)|[``](filesystem.md), [``](fstream.md), [``](iomanip.md), [``](ios.md), [``](iosfwd.md), [``](iostream.md), [``](istream.md), [``](ostream.md), [``](sstream.md), [``](streambuf.md), [``](strstream.md)| +|Iterators|[``](iterator.md)| +|Localization|[``](codecvt.md), [``](cvt-wbuffer.md), [``](cvt-wstring.md), [``](locale.md)| +|Math and numerics|[``](complex.md), [``](limits.md), [``](numeric.md), [``](random.md), [``](ratio.md), [``](valarray.md)| +|[Memory Management](../cpp/smart-pointers-modern-cpp.md)|[``](allocators-header.md), [``](memory.md), [``](new.md), [``](scoped-allocator.md)| +|Multithreading|[``](atomic.md), [``](condition-variable.md), [``](future.md), [``](mutex.md), [``](shared-mutex.md), [``](thread.md)| +|Other utilities|[``](bitset.md), [``](chrono.md), [``](functional.md), [``](initializer-list.md), [``](tuple.md), [``](type-traits.md), [``](typeinfo.md), [``](typeindex.md), [``](utility.md)| +|Strings and character data|[``](regex.md), [``](string.md), [``](string-view.md)| ::: moniker-end diff --git a/docs/standard-library/cpp-standard-library-overview.md b/docs/standard-library/cpp-standard-library-overview.md index e32e6edf3ad..d973bef5be6 100644 --- a/docs/standard-library/cpp-standard-library-overview.md +++ b/docs/standard-library/cpp-standard-library-overview.md @@ -7,16 +7,16 @@ ms.assetid: 7acb83a4-da73-4ad3-bc30-a71289db7f60 --- # C++ Standard Library Overview -All C++ library entities are declared or defined in one or more standard headers. This implementation includes two additional headers, \ and \, that are not required by the C++ Standard. For a complete list of headers that this implementation supports, see [Header Files Reference](../standard-library/cpp-standard-library-header-files.md). +All C++ library entities are declared or defined in one or more standard headers. This implementation includes two additional headers, `` and ``, that are not required by the C++ Standard. For a complete list of headers that this implementation supports, see [Header Files Reference](../standard-library/cpp-standard-library-header-files.md). A freestanding implementation of the C++ library provides only a subset of these headers: -[\](../standard-library/cstdarg.md)\ -[\](../standard-library/cstddef.md)\ -[\](../standard-library/cstdlib.md) (declaring at least the functions `abort`, `atexit`, and `exit`)\ -[\](../standard-library/exception.md)\ -[\](../standard-library/limits.md)\ -[\](../standard-library/new.md) +[``](../standard-library/cstdarg.md)\ +[``](../standard-library/cstddef.md)\ +[``](../standard-library/cstdlib.md) (declaring at least the functions `abort`, `atexit`, and `exit`)\ +[``](../standard-library/exception.md)\ +[``](../standard-library/limits.md)\ +[``](../standard-library/new.md) The C++ library headers have two broader subdivisions: diff --git a/docs/standard-library/filesystem.md b/docs/standard-library/filesystem.md index 03efa25ab0f..506514f9272 100644 --- a/docs/standard-library/filesystem.md +++ b/docs/standard-library/filesystem.md @@ -18,8 +18,8 @@ using namespace std::experimental::filesystem::v1; ``` > [!IMPORTANT] -> At the release of Visual Studio 2017, the \ header was not yet a C++ standard. C++ in Visual Studio 2017 RTW implements the final draft standard, found in [ISO/IEC JTC 1/SC 22/WG 21 N4100](https://wg21.link/n4100). Visual Studio 2017 version 15.7 and later supports the new C++17 \ standard. -> This is a completely new implementation, incompatible with the previous `std::experimental` version. It was made necessary by symlink support, bug fixes, and changes in standard-required behavior. Currently, including \ provides the new `std::filesystem` and the previous `std::experimental::filesystem`. Including \ provides only the old experimental implementation. The experimental implementation will be removed in the next ABI-breaking release of the libraries. +> At the release of Visual Studio 2017, the `` header was not yet a C++ standard. C++ in Visual Studio 2017 RTW implements the final draft standard, found in [ISO/IEC JTC 1/SC 22/WG 21 N4100](https://wg21.link/n4100). Visual Studio 2017 version 15.7 and later supports the new C++17 `` standard. +> This is a completely new implementation, incompatible with the previous `std::experimental` version. It was made necessary by symlink support, bug fixes, and changes in standard-required behavior. Currently, including `` provides the new `std::filesystem` and the previous `std::experimental::filesystem`. Including `` provides only the old experimental implementation. The experimental implementation will be removed in the next ABI-breaking release of the libraries. This header supports file systems for one of two broad classes of host operating systems: Microsoft Windows and POSIX. @@ -75,7 +75,7 @@ Common to both systems is the structure imposed on a pathname once you get past A minor difference is the preferred separator between the sequence of directories in a pathname. Both operating systems let you write a forward slash `/`, but in some contexts Windows prefers a backslash `\`. The implementation stores its preferred separator in the data member `preferred_separator` in `path`. -Finally, `path` objects have an important feature: You can use them wherever a filename argument is required in the classes defined in the header [\](fstream.md). +Finally, `path` objects have an important feature: You can use them wherever a filename argument is required in the classes defined in the header [``](fstream.md). For more information and code examples, see [File system navigation (C++)](../standard-library/file-system-navigation.md). @@ -100,11 +100,11 @@ For more information and code examples, see [File system navigation (C++)](../st ## Functions -[\ functions](../standard-library/filesystem-functions.md) +[`` functions](../standard-library/filesystem-functions.md) ## Operators -[\ operators](../standard-library/filesystem-operators.md) +[`` operators](../standard-library/filesystem-operators.md) ## Enumerations diff --git a/docs/standard-library/iostream.md b/docs/standard-library/iostream.md index 0988d261ce4..4c255daefd2 100644 --- a/docs/standard-library/iostream.md +++ b/docs/standard-library/iostream.md @@ -6,7 +6,7 @@ f1_keywords: ["", "iostream/std::cerr", "iostream/std::cin", "iostream helpviewer_keywords: ["iostream header"] ms.assetid: de5d39e1-7e77-4b55-bcd1-7c77b41515c8 --- -# <iostream> +# `` Declares objects that control reading from and writing to the standard streams. This include is often the only header you need to do input and output from a C++ program. @@ -17,38 +17,38 @@ Declares objects that control reading from and writing to the standard streams. ``` > [!NOTE] -> The \ library uses the `#include `, `#include `, `#include `, and `#include ` statements. +> The `` library uses the `#include `, `#include `, `#include `, and `#include ` statements. ## Remarks The objects fall into two groups: -- [cin](#cin), [cout](#cout), [cerr](#cerr), and [clog](#clog) are byte oriented, doing conventional byte-at-a-time transfers. +- [`cin`](#cin), [`cout`](#cout), [`cerr`](#cerr), and [`clog`](#clog) are byte oriented, doing conventional byte-at-a-time transfers. -- [wcin](#wcin), [wcout](#wcout), [wcerr](#wcerr), and [wclog](#wclog) are wide oriented, translating to and from the wide characters that the program manipulates internally. +- [`wcin`](#wcin), [`wcout`](#wcout), [`wcerr`](#wcerr), and [`wclog`](#wclog) are wide oriented, translating to and from the wide characters that the program manipulates internally. -Once you do certain operations on a stream, such as the standard input, you can't do operations of a different orientation on the same stream. Therefore, a program can't operate interchangeably on both [cin](#cin) and [wcin](#wcin), for example. +Once you do certain operations on a stream, such as the standard input, you can't do operations of a different orientation on the same stream. Therefore, a program can't operate interchangeably on both [`cin`](#cin) and [`wcin`](#wcin), for example. -All the objects declared in this header share a peculiar property — you can assume they're constructed before any static objects you define, in a translation unit that includes \. Equally, you can assume that these objects aren't destroyed before the destructors for any such static objects you define. (The output streams are, however, flushed during program termination.) Therefore, you can safely read from or write to the standard streams before program startup and after program termination. +All the objects declared in this header share a peculiar property — you can assume they're constructed before any static objects you define, in a translation unit that includes ``. Equally, you can assume that these objects aren't destroyed before the destructors for any such static objects you define. (The output streams are, however, flushed during program termination.) Therefore, you can safely read from or write to the standard streams before program startup and after program termination. -This guarantee isn't universal, however. A static constructor may call a function in another translation unit. The called function can't assume that the objects declared in this header have been constructed, given the uncertain order in which translation units participate in static construction. To use these objects in such a context, you must first construct an object of class [ios_base::Init](../standard-library/ios-base-class.md#init). +This guarantee isn't universal, however. A static constructor may call a function in another translation unit. The called function can't assume that the objects declared in this header have been constructed, given the uncertain order in which translation units participate in static construction. To use these objects in such a context, you must first construct an object of class [`ios_base::Init`](../standard-library/ios-base-class.md#init). ### Global Stream Objects |Name|Description| |-|-| -|[cerr](#cerr)|Specifies the `cerr` global stream.| -|[cin](#cin)|Specifies the `cin` global stream.| -|[clog](#clog)|Specifies the `clog` global stream.| -|[cout](#cout)|Specifies the `cout` global stream.| -|[wcerr](#wcerr)|Specifies the `wcerr` global stream.| -|[wcin](#wcin)|Specifies the `wcin` global stream.| -|[wclog](#wclog)|Specifies the `wclog` global stream.| -|[wcout](#wcout)|Specifies the `wcout` global stream.| +|[`cerr`](#cerr)|Specifies the `cerr` global stream.| +|[`cin`](#cin)|Specifies the `cin` global stream.| +|[`clog`](#clog)|Specifies the `clog` global stream.| +|[`cout`](#cout)|Specifies the `cout` global stream.| +|[`wcerr`](#wcerr)|Specifies the `wcerr` global stream.| +|[`wcin`](#wcin)|Specifies the `wcin` global stream.| +|[`wclog`](#wclog)|Specifies the `wclog` global stream.| +|[`wcout`](#wcout)|Specifies the `wcout` global stream.| -### cerr +### `cerr` -The object `cerr` controls output to a stream buffer associated with the object `stderr`, declared in \. +The object `cerr` controls output to a stream buffer associated with the object `stderr`, declared in ``. ```cpp extern ostream cerr; @@ -56,11 +56,11 @@ extern ostream cerr; #### Return Value -An [ostream](../standard-library/ostream-typedefs.md#ostream) object. +An [`ostream`](../standard-library/ostream-typedefs.md#ostream) object. #### Remarks -The object controls unbuffered insertions to the standard error output as a byte stream. Once the object is constructed, the expression `cerr.`[flags](../standard-library/ios-base-class.md#flags) `&` [unitbuf](../standard-library/ios-functions.md#unitbuf) is nonzero, and `cerr.tie() == &cout`. +The object controls unbuffered insertions to the standard error output as a byte stream. Once the object is constructed, the expression `cerr.flags & unitbuf` is nonzero, and `cerr.tie() == &cout`. For more details, see [`cerr.flags`](../standard-library/ios-base-class.md#flags) and [`unitbuf`](../standard-library/ios-functions.md#unitbuf). #### Example @@ -92,7 +92,7 @@ int main( ) } ``` -### cin +### `cin` Specifies the `cin` global stream. @@ -102,11 +102,11 @@ extern istream cin; #### Return Value -An [istream](../standard-library/istream-typedefs.md#istream) object. +An [`istream`](../standard-library/istream-typedefs.md#istream) object. #### Remarks -The object controls extractions from the standard input as a byte stream. Once the object is constructed, the call `cin.`[tie](../standard-library/basic-ios-class.md#tie) returns `&`[cout](#cout). +The object controls extractions from the standard input as a byte stream. Once the object is constructed, the call [`cin.tie`](../standard-library/basic-ios-class.md#tie) returns [`&cout`](#cout). #### Example @@ -143,7 +143,7 @@ int main() 2 ``` -### clog +### `clog` Specifies the `clog` global stream. @@ -153,7 +153,7 @@ extern ostream clog; #### Return Value -An [ostream](../standard-library/ostream-typedefs.md#ostream) object. +An [`ostream`](../standard-library/ostream-typedefs.md#ostream) object. #### Remarks @@ -161,9 +161,9 @@ The object controls buffered insertions to the standard error output as a byte s #### Example -See [cerr](#cerr) for an example of using `clog`. +See [`cerr`](#cerr) for an example of using `clog`. -### cout +### `cout` Specifies the `cout` global stream. @@ -173,7 +173,7 @@ extern ostream cout; #### Return Value -An [ostream](../standard-library/ostream-typedefs.md#ostream) object. +An [`ostream`](../standard-library/ostream-typedefs.md#ostream) object. #### Remarks @@ -181,9 +181,9 @@ The object controls insertions to the standard output as a byte stream. #### Example -See [cerr](#cerr) for an example of using `cout`. +See [`cerr`](#cerr) for an example of using `cout`. -### wcerr +### `wcerr` Specifies the `wcerr` global stream. @@ -193,17 +193,17 @@ extern wostream wcerr; #### Return Value -A [wostream](../standard-library/ostream-typedefs.md#wostream) object. +A [`wostream`](../standard-library/ostream-typedefs.md#wostream) object. #### Remarks -The object controls unbuffered insertions to the standard error output as a wide stream. Once the object is constructed, the expression `wcerr.`[flags](../standard-library/ios-base-class.md#flags) `&` [unitbuf](../standard-library/ios-functions.md#unitbuf) is nonzero. +The object controls unbuffered insertions to the standard error output as a wide stream. Once the object is constructed, the expression `wcerr.flags & unitbuf` is nonzero. For more details, see [`wcerr.flags`](../standard-library/ios-base-class.md#flags) and [`unitbuf`](../standard-library/ios-functions.md#unitbuf). #### Example -See [cerr](#cerr) for an example of using `wcerr`. +See [`cerr`](#cerr) for an example of using `wcerr`. -### wcin +### `wcin` Specifies the `wcin` global stream. @@ -213,17 +213,17 @@ extern wistream wcin; #### Return Value -A [wistream](../standard-library/istream-typedefs.md#wistream) object. +A [`wistream`](../standard-library/istream-typedefs.md#wistream) object. #### Remarks -The object controls extractions from the standard input as a wide stream. Once the object is constructed, the call `wcin.`[tie](../standard-library/basic-ios-class.md#tie) returns `&`[wcout](#wcout). +The object controls extractions from the standard input as a wide stream. Once the object is constructed, the call [`wcin.tie`](../standard-library/basic-ios-class.md#tie) returns [`&wcout`](#wcout). #### Example -See [cerr](#cerr) for an example of using `wcin`. +See [`cerr`](#cerr) for an example of using `wcin`. -### wclog +### `wclog` Specifies the `wclog` global stream. @@ -233,7 +233,7 @@ extern wostream wclog; #### Return Value -A [wostream](../standard-library/ostream-typedefs.md#wostream) object. +A [`wostream`](../standard-library/ostream-typedefs.md#wostream) object. #### Remarks @@ -241,9 +241,9 @@ The object controls buffered insertions to the standard error output as a wide s #### Example -See [cerr](#cerr) for an example of using `wclog`. +See [`cerr`](#cerr) for an example of using `wclog`. -### wcout +### `wcout` Specifies the `wcout` global stream. @@ -253,7 +253,7 @@ extern wostream wcout; #### Return Value -A [wostream](../standard-library/ostream-typedefs.md#wostream) object. +A [`wostream`](../standard-library/ostream-typedefs.md#wostream) object. #### Remarks @@ -261,7 +261,7 @@ The object controls insertions to the standard output as a wide stream. #### Example -See [cerr](#cerr) for an example of using `wcout`. +See [`cerr`](#cerr) for an example of using `wcout`. `CString` instances in a `wcout` statement must be cast to `const wchar_t*`, as shown in the following example. diff --git a/docs/standard-library/map-class.md b/docs/standard-library/map-class.md index 1021c6abe46..f9362d27f84 100644 --- a/docs/standard-library/map-class.md +++ b/docs/standard-library/map-class.md @@ -23,18 +23,18 @@ class map; ### Parameters -*Key*\ +*`Key`*\ The key data type to be stored in the `map`. -*Type*\ +*`Type`*\ The element data type to be stored in the `map`. -*Traits*\ +*`Traits`*\ The type that provides a function object that can compare two element values as sort keys to determine their relative order in the `map`. This argument is optional and the binary predicate `less` is the default value. -In C++14, you can enable heterogeneous lookup by specifying the std::less<> predicate that has no type parameters. See [Heterogeneous Lookup in Associative Containers](../standard-library/stl-containers.md#sequence_containers) for more information. +In C++14, you can enable heterogeneous lookup by specifying the `std::less<>` predicate that has no type parameters. See [Heterogeneous Lookup in Associative Containers](../standard-library/stl-containers.md#sequence_containers) for more information. -*Allocator*\ +*`Allocator`*\ The type that represents the stored allocator object that encapsulates details about the map's allocation and deallocation of memory. This argument is optional and the default value is `allocator >`. ## Remarks @@ -53,13 +53,13 @@ The C++ Standard Library map class is: - A class template, because the functionality it provides is generic and independent of element or key type. The data types used for elements and keys are specified as parameters in the class template together with the comparison function and allocator. -The iterator provided by the map class is a bidirectional iterator, but the [insert](#insert) and [map](#map) class member functions have versions that take as template parameters a weaker input iterator, whose functionality requirements are fewer than those guaranteed by the class of bidirectional iterators. The different iterator concepts are related by refinements in their functionality. Each iterator concept has its own set of requirements, and the algorithms that work with it must be limited by those requirements. An input iterator may be dereferenced to refer to some object and may be incremented to the next iterator in the sequence. +The iterator provided by the map class is a bidirectional iterator, but the [`insert`](#insert) and [`map`](#map) class member functions have versions that take as template parameters a weaker input iterator, whose functionality requirements are fewer than those guaranteed by the class of bidirectional iterators. The different iterator concepts are related by refinements in their functionality. Each iterator concept has its own set of requirements, and the algorithms that work with it must be limited by those requirements. An input iterator may be dereferenced to refer to some object and may be incremented to the next iterator in the sequence. We recommend that you base the choice of container type on the kind of searching and inserting that is required by the application. Associative containers are optimized for the operations of lookup, insertion, and removal. The member functions that explicitly support these operations do them in a worst-case time that is proportional to the logarithm of the number of elements in the container. Inserting elements invalidates no iterators, and removing elements invalidates only those iterators that specifically pointed to the removed elements. We recommend that you make the map the associative container of choice when conditions that associate values with keys are satisfied by the application. A model for this kind of structure is an ordered list of uniquely occurring key words that have associated string values that provide definitions. If a word has more than one correct definition, so that key isn't unique, then a multimap would be the container of choice. If just the list of words is being stored, then a set would be the appropriate container. If multiple occurrences of the words are allowed, then a multiset would be appropriate. -The map orders the elements it controls by calling a stored function object of type [key_compare](#key_compare). This stored object is a comparison function that is accessed by calling the [key_comp](#key_comp) method. In general, any two given elements are compared to determine whether one is less than the other or whether they're equivalent. As all elements are compared, an ordered sequence of non-equivalent elements is created. +The map orders the elements it controls by calling a stored function object of type [`key_compare`](#key_compare). This stored object is a comparison function that is accessed by calling the [`key_comp`](#key_comp) method. In general, any two given elements are compared to determine whether one is less than the other or whether they're equivalent. As all elements are compared, an ordered sequence of non-equivalent elements is created. > [!NOTE] > The comparison function is a binary predicate that induces a strict weak ordering in the standard mathematical sense. A binary predicate f(x,y) is a function object that has two argument objects x and y, and a return value of **`true`** or **`false`**. An ordering imposed on a set is a strict weak ordering if the binary predicate is irreflexive, antisymmetric, and transitive, and if equivalence is transitive, where two objects x and y are defined to be equivalent when both f(x,y) and f(y,x) are **`false`**. If the stronger condition of equality between keys replaces that of equivalence, the ordering becomes total (in the sense that all the elements are ordered with regard to one other), and the keys matched will be indiscernible from one other. @@ -72,68 +72,68 @@ The map orders the elements it controls by calling a stored function object of t |Name|Description| |-|-| -|[map](#map)|Constructs a list of a specific size or with elements of a specific value or with a specific `allocator` or as a copy of some other map.| +|[`map`](#map)|Constructs a list of a specific size or with elements of a specific value or with a specific `allocator` or as a copy of some other map.| ### Typedefs |Name|Description| |-|-| -|[allocator_type](#allocator_type)|A typedef for the `allocator` class for the map object.| -|[const_iterator](#const_iterator)|A typedef for a bidirectional iterator that can read a **`const`** element in the `map`.| -|[const_pointer](#const_pointer)|A typedef for a pointer to a **`const`** element in a map.| -|[const_reference](#const_reference)|A typedef for a reference to a **`const`** element stored in a map for reading and doing **`const`** operations.| -|[const_reverse_iterator](#const_reverse_iterator)|A type that provides a bidirectional iterator that can read any **`const`** element in the `map`.| -|[difference_type](#difference_type)|A signed integer typedef for the number of elements of a map in a range between elements pointed to by iterators.| -|[iterator](#iterator)|A typedef for a bidirectional iterator that can read or modify any element in a map.| -|[key_compare](#key_compare)|A typedef for a function object that can compare two sort keys to determine the relative order of two elements in the `map`.| -|[key_type](#key_type)|A typedef for the sort key stored in each element of the map.| -|[mapped_type](#mapped_type)|A typedef for the data stored in each element of a map.| -|[pointer](#pointer)|A typedef for a pointer to a **`const`** element in a map.| -|[reference](#reference)|A typedef for a reference to an element stored in a map.| -|[reverse_iterator](#reverse_iterator)|A typedef for a bidirectional iterator that can read or modify an element in a reversed map.| -|[size_type](#size_type)|An unsigned integer typedef for the number of elements in a map| -|[value_type](#value_type)|A typedef for the type of object stored as an element in a map.| +|[`allocator_type`](#allocator_type)|A typedef for the `allocator` class for the map object.| +|[`const_iterator`](#const_iterator)|A typedef for a bidirectional iterator that can read a **`const`** element in the `map`.| +|[`const_pointer`](#const_pointer)|A typedef for a pointer to a **`const`** element in a map.| +|[`const_reference`](#const_reference)|A typedef for a reference to a **`const`** element stored in a map for reading and doing **`const`** operations.| +|[`const_reverse_iterator`](#const_reverse_iterator)|A type that provides a bidirectional iterator that can read any **`const`** element in the `map`.| +|[`difference_type`](#difference_type)|A signed integer typedef for the number of elements of a map in a range between elements pointed to by iterators.| +|[`iterator`](#iterator)|A typedef for a bidirectional iterator that can read or modify any element in a map.| +|[`key_compare`](#key_compare)|A typedef for a function object that can compare two sort keys to determine the relative order of two elements in the `map`.| +|[`key_type`](#key_type)|A typedef for the sort key stored in each element of the map.| +|[`mapped_type`](#mapped_type)|A typedef for the data stored in each element of a map.| +|[`pointer`](#pointer)|A typedef for a pointer to a **`const`** element in a map.| +|[`reference`](#reference)|A typedef for a reference to an element stored in a map.| +|[`reverse_iterator`](#reverse_iterator)|A typedef for a bidirectional iterator that can read or modify an element in a reversed map.| +|[`size_type`](#size_type)|An unsigned integer typedef for the number of elements in a map| +|[`value_type`](#value_type)|A typedef for the type of object stored as an element in a map.| ### Member functions |Member function|Description| |-|-| -|[at](#at)|Finds an element with the specified key value.| -|[begin](#begin)|Returns an iterator that points to the first element in the `map`.| -|[cbegin](#cbegin)|Returns a const iterator that points to the first element in the `map`.| -|[cend](#cend)|Returns a const past-the-end iterator.| -|[clear](#clear)|Erases all the elements of a `map`.| -|[contains](#contains)C++20|Check if there's an element with the specified key in the `map`.| -|[count](#count)|Returns the number of elements in a map whose key matches the key specified in a parameter.| -|[crbegin](#crbegin)|Returns a const iterator that points to the first element in a reversed `map`.| -|[crend](#crend)|Returns a const iterator that points to the location after the last element in a reversed `map`.| -|[emplace](#emplace)|Inserts an element constructed in place into the `map`.| -|[emplace_hint](#emplace_hint)|Inserts an element constructed in place into the `map`, with a placement hint.| -|[empty](#empty)|Returns **`true`** if a `map` is empty.| -|[end](#end)|Returns the past-the-end iterator.| -|[equal_range](#equal_range)|Returns a pair of iterators. The first iterator in the pair points to the first element in a `map` with a key that is greater than a specified key. The second iterator in the pair points to the first element in the `map` with a key that is equal to or greater than the key.| -|[erase](#erase)|Removes an element or a range of elements in a map from the specified positions.| -|[find](#find)|Returns an iterator that points to the location of an element in a `map` that has a key equal to a specified key.| -|[get_allocator](#get_allocator)|Returns a copy of the `allocator` object that is used to construct the `map`.| -|[insert](#insert)|Inserts an element or a range of elements into the `map` at a specified position.| -|[key_comp](#key_comp)|Returns a copy of the comparison object that used to order keys in a `map`.| -|[lower_bound](#lower_bound)|Returns an iterator to the first element in a `map` that has a key value that is equal to or greater than that of a specified key.| -|[max_size](#max_size)|Returns the maximum length of the `map`.| -|[rbegin](#rbegin)|Returns an iterator that points to the first element in a reversed `map`.| -|[rend](#rend)|Returns an iterator that points to the location after the last element in a reversed `map`.| -|[size](#size)|Returns the number of elements in the `map`.| -|[swap](#swap)|Exchanges the elements of two maps.| -|[upper_bound](#upper_bound)|Returns an iterator to the first element in a `map` that has a key value that is greater than that of a specified key.| -|[value_comp](#value_comp)|Retrieves a copy of the comparison object that is used to order element values in a `map`.| +|[`at`](#at)|Finds an element with the specified key value.| +|[`begin`](#begin)|Returns an iterator that points to the first element in the `map`.| +|[`cbegin`](#cbegin)|Returns a const iterator that points to the first element in the `map`.| +|[`cend`](#cend)|Returns a const past-the-end iterator.| +|[`clear`](#clear)|Erases all the elements of a `map`.| +|[`contains`](#contains)C++20|Check if there's an element with the specified key in the `map`.| +|[`count`](#count)|Returns the number of elements in a map whose key matches the key specified in a parameter.| +|[`crbegin`](#crbegin)|Returns a const iterator that points to the first element in a reversed `map`.| +|[`crend`](#crend)|Returns a const iterator that points to the location after the last element in a reversed `map`.| +|[`emplace`](#emplace)|Inserts an element constructed in place into the `map`.| +|[`emplace_hint`](#emplace_hint)|Inserts an element constructed in place into the `map`, with a placement hint.| +|[`empty`](#empty)|Returns **`true`** if a `map` is empty.| +|[`end`](#end)|Returns the past-the-end iterator.| +|[`equal_range`](#equal_range)|Returns a pair of iterators. The first iterator in the pair points to the first element in a `map` with a key that is greater than a specified key. The second iterator in the pair points to the first element in the `map` with a key that is equal to or greater than the key.| +|[`erase`](#erase)|Removes an element or a range of elements in a map from the specified positions.| +|[`find`](#find)|Returns an iterator that points to the location of an element in a `map` that has a key equal to a specified key.| +|[`get_allocator`](#get_allocator)|Returns a copy of the `allocator` object that is used to construct the `map`.| +|[`insert`](#insert)|Inserts an element or a range of elements into the `map` at a specified position.| +|[`key_comp`](#key_comp)|Returns a copy of the comparison object that used to order keys in a `map`.| +|[`lower_bound`](#lower_bound)|Returns an iterator to the first element in a `map` that has a key value that is equal to or greater than that of a specified key.| +|[`max_size`](#max_size)|Returns the maximum length of the `map`.| +|[`rbegin`](#rbegin)|Returns an iterator that points to the first element in a reversed `map`.| +|[`rend`](#rend)|Returns an iterator that points to the location after the last element in a reversed `map`.| +|[`size`](#size)|Returns the number of elements in the `map`.| +|[`swap`](#swap)|Exchanges the elements of two maps.| +|[`upper_bound`](#upper_bound)|Returns an iterator to the first element in a `map` that has a key value that is greater than that of a specified key.| +|[`value_comp`](#value_comp)|Retrieves a copy of the comparison object that is used to order element values in a `map`.| ### Operators |Name|Description| |-|-| -|[operator[]](#op_at)|Inserts an element into a map with a specified key value.| -|[operator=](#op_eq)|Replaces the elements of a map with a copy of another map.| +|[`operator[]`](#op_at)|Inserts an element into a map with a specified key value.| +|[`operator=`](#op_eq)|Replaces the elements of a map with a copy of another map.| -## allocator_type +## `allocator_type` A type that represents the allocator class for the map object. @@ -143,9 +143,9 @@ typedef Allocator allocator_type; ### Example -See example for [get_allocator](#get_allocator) for an example that uses `allocator_type`. +See example for [`get_allocator`](#get_allocator) for an example that uses `allocator_type`. -## at +## `at` Finds an element with a specified key value. @@ -157,7 +157,7 @@ const Type& at(const Key& key) const; ### Parameters -key*\ +*`key`*\ The key value to find. ### Return Value @@ -166,7 +166,7 @@ A reference to the data value of the element found. ### Remarks -If the argument key value isn't found, then the function throws an object of class [out_of_range Class](../standard-library/out-of-range-class.md). +If the argument key value isn't found, then the function throws an object of class [`out_of_range` Class](../standard-library/out-of-range-class.md). ### Example @@ -194,7 +194,7 @@ int main() } ``` -## begin +## `begin` Returns an iterator addressing the first element in the `map`. @@ -249,7 +249,7 @@ The first element of m1 is 0 The first element of m1 is now 1 ``` -## cbegin +## `cbegin` Returns a **`const`** iterator that addresses the location just beyond the last element in a range. @@ -265,7 +265,7 @@ A **`const`** bidirectional iterator addressing the first element in the range, With the return value of `cbegin`, the elements in the range can't be modified. -You can use this member function in place of the `begin()` member function to guarantee that the return value is `const_iterator`. Typically, it's used in conjunction with the [auto](../cpp/auto-cpp.md) type deduction keyword, as shown in the following example. In the example, consider `Container` to be a modifiable (non- **`const`**) container of any kind that supports `begin()` and `cbegin()`. +You can use this member function in place of the `begin()` member function to guarantee that the return value is `const_iterator`. Typically, it's used in conjunction with the [`auto`](../cpp/auto-cpp.md) type deduction keyword, as shown in the following example. In the example, consider `Container` to be a modifiable (non- **`const`**) container of any kind that supports `begin()` and `cbegin()`. ```cpp auto i1 = Container.begin(); @@ -275,7 +275,7 @@ auto i2 = Container.cbegin(); // i2 is Container::const_iterator ``` -## cend +## ` cend` Returns a **`const`** iterator that addresses the location just beyond the last element in a range. @@ -291,7 +291,7 @@ A **`const`** bidirectional-access iterator that points just beyond the end of t `cend` is used to test whether an iterator has passed the end of its range. -You can use this member function in place of the `end()` member function to guarantee that the return value is `const_iterator`. Typically, it's used in conjunction with the [auto](../cpp/auto-cpp.md) type deduction keyword, as shown in the following example. In the example, consider `Container` to be a modifiable (non- **`const`**) container of any kind that supports `end()` and `cend()`. +You can use this member function in place of the `end()` member function to guarantee that the return value is `const_iterator`. Typically, it's used in conjunction with the [`auto`](../cpp/auto-cpp.md) type deduction keyword, as shown in the following example. In the example, consider `Container` to be a modifiable (non- **`const`**) container of any kind that supports `end()` and `cend()`. ```cpp auto i1 = Container.end(); @@ -303,7 +303,7 @@ auto i2 = Container.cend(); The value returned by `cend` should not be dereferenced. -## clear +## `clear` Erases all the elements of a map. @@ -313,7 +313,7 @@ void clear(); ### Example -The following example demonstrates the use of the map::clear member function. +The following example demonstrates the use of the `map::clear` member function. ```cpp // map_clear.cpp @@ -347,7 +347,7 @@ The size of the map is initially 2. The size of the map after clearing is 0. ``` -## const_iterator +## `const_iterator` A type that provides a bidirectional iterator that can read a **`const`** element in the `map`. @@ -359,19 +359,19 @@ typedef implementation-defined const_iterator; A type `const_iterator` can't be used to modify the value of an element. -The `const_iterator` defined by map points to elements that are objects of [value_type](#value_type), that is of type `pair`\< **constKey**, **Type**>, whose first member is the key to the element and whose second member is the mapped datum held by the element. +The `const_iterator` defined by map points to elements that are objects of [`value_type`](#value_type), that is of type `pair`, whose first member is the key to the element and whose second member is the mapped datum held by the element. To dereference a `const_iterator` `cIter` pointing to an element in a map, use the `->` operator. -To access the value of the key for the element, use `cIter` -> **first**, which is equivalent to (\* `cIter`). **first**. +To access the value of the key for the element, use `cIter` -> **`first`**, which is equivalent to (\* `cIter`). **`first`**. -To access the value of the mapped datum for the element, use `cIter` -> **second**, which is equivalent to (\* `cIter`). **second**. +To access the value of the mapped datum for the element, use `cIter` -> **`second`**, which is equivalent to (\* `cIter`). **`second`**. ### Example -See example for [begin](#begin) for an example that uses `const_iterator`. +See example for [`begin`](#begin) for an example that uses `const_iterator`. -## const_pointer +## `const_pointer` A type that provides a pointer to a **`const`** element in a map. @@ -383,9 +383,9 @@ typedef typename allocator_type::const_pointer const_pointer; A type `const_pointer` can't be used to modify the value of an element. -In most cases, an [iterator](#iterator) should be used to access the elements in a map object. +In most cases, an [`iterator`](#iterator) should be used to access the elements in a map object. -## const_reference +## `const_reference` A type that provides a reference to a **`const`** element stored in a map for reading and doing **`const`** operations. @@ -435,7 +435,7 @@ The key of first element in the map is 1. The data value of first element in the map is 10. ``` -## const_reverse_iterator +## `const_reverse_iterator` A type that provides a bidirectional iterator that can read any **`const`** element in the `map`. @@ -447,19 +447,19 @@ typedef std::reverse_iterator const_reverse_iterator; A type `const_reverse_iterator` can't modify the value of an element and is used to iterate through the map in reverse. -The `const_reverse_iterator` defined by map points to elements that are objects of [value_type](#value_type), that is of type `pair`, whose first member is the key to the element and whose second member is the mapped datum held by the element. +The `const_reverse_iterator` defined by map points to elements that are objects of [`value_type`](#value_type), that is of type `pair`, whose first member is the key to the element and whose second member is the mapped datum held by the element. To dereference a `const_reverse_iterator crIter` pointing to an element in a map, use the `->` operator. -To access the value of the key for the element, use `crIter` -> **first**, which is equivalent to (\* `crIter`).**first**. +To access the value of the key for the element, use `crIter` -> **`first`**, which is equivalent to (\* `crIter`).**`first`**. -To access the value of the mapped datum for the element, use `crIter` -> **second**, which is equivalent to (\* `crIter`).**first**. +To access the value of the mapped datum for the element, use `crIter` -> **`second`**, which is equivalent to (\* `crIter`).**`first`**. ### Example -See the example for [rend](#rend) for an example of how to declare and use `const_reverse_iterator`. +See the example for [`rend`](#rend) for an example of how to declare and use `const_reverse_iterator`. -## count +## `count` Returns the number of elements in a map whose key matches a parameter-specified key. @@ -469,7 +469,7 @@ size_type count(const Key& key) const; ### Parameters -*key*\ +*`key`*\ The key value of the elements to be matched from the map. ### Return Value @@ -486,7 +486,7 @@ which is 0 or 1 in the case of map, which is a unique associative container. ### Example -The following example demonstrates the use of the map::count member function. +The following example demonstrates the use of the `map::count` member function. ```cpp // map_count.cpp @@ -527,7 +527,7 @@ The number of elements in m1 with a sort key of 2 is: 1. The number of elements in m1 with a sort key of 3 is: 0. ``` -## contains +## `contains` Checks if there's an element with the specified key in the `map`. @@ -538,10 +538,10 @@ template bool contains(const K& key) const; ### Parameters -*K*\ +*`K`*\ The type of the key. -*key*\ +*`key`*\ The element's key value to look for. ### Return Value @@ -550,7 +550,7 @@ The element's key value to look for. ### Remarks -`contains()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option. +`contains()` is new in C++20. To use it, specify the [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option. `template bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](./stl-containers.md#heterogeneous-lookup-in-associative-containers-c14) for more information. @@ -585,7 +585,7 @@ false true ``` -## crbegin +## `crbegin` Returns a const iterator addressing the first element in a reversed map. @@ -595,11 +595,11 @@ const_reverse_iterator crbegin() const; ### Return Value -A const reverse bidirectional iterator addressing the first element in a reversed [map](../standard-library/map-class.md) or addressing what had been the last element in the unreversed `map`. +A const reverse bidirectional iterator addressing the first element in a reversed [`map`](../standard-library/map-class.md) or addressing what had been the last element in the unreversed `map`. ### Remarks -`crbegin` is used with a reversed `map` just as [begin](#begin) is used with a `map`. +`crbegin` is used with a reversed `map` just as [`begin`](#begin) is used with a `map`. With the return value of `crbegin`, the `map` object can't be modified @@ -635,7 +635,7 @@ int main( ) The first element of the reversed map m1 is 3. ``` -## crend +## `crend` Returns a const iterator that addresses the location succeeding the last element in a reversed map. @@ -645,11 +645,11 @@ const_reverse_iterator crend() const; ### Return Value -A const reverse bidirectional iterator that addresses the location succeeding the last element in a reversed [map](../standard-library/map-class.md) (the location that had preceded the first element in the unreversed `map`). +A const reverse bidirectional iterator that addresses the location succeeding the last element in a reversed [`map`](../standard-library/map-class.md) (the location that had preceded the first element in the unreversed `map`). ### Remarks -`crend` is used with a reversed map just as [end](#end) is used with a `map`. +`crend` is used with a reversed map just as [`end`](#end) is used with a `map`. With the return value of `crend`, the `map` object can't be modified. @@ -688,7 +688,7 @@ int main( ) The last element of the reversed map m1 is 1. ``` -## difference_type +## `difference_type` A signed integer type that can be used to represent the number of elements of a map in a range between elements pointed to by iterators. @@ -744,7 +744,7 @@ int main( ) The number of elements in the map m1 is: 4. ``` -## emplace +## `emplace` Inserts an element constructed in place (no copy or move operations are performed) into a map. @@ -757,12 +757,12 @@ emplace( ### Parameters -*args*\ +*`args`*\ The arguments forwarded to construct an element to insert into the map unless it already contains an element whose value is equivalently ordered. ### Return Value -A [pair](../standard-library/pair-structure.md) whose **`bool`** component is true if an insertion was made, and false if the map already contained an element of equivalent value in the ordering. The iterator component of the return-value pair points to the newly inserted element if the **`bool`** component is true, or to the existing element if the **`bool`** component is false. +A [`pair`](../standard-library/pair-structure.md) whose **`bool`** component is `true` if an insertion was made, and `false` if the map already contained an element of equivalent value in the ordering. The iterator component of the return-value pair points to the newly inserted element if the **`bool`** component is true, or to the existing element if the **`bool`** component is false. To access the iterator component of a `pair` `pr`, use `pr.first`; to dereference it, use `*pr.first`. To access the **`bool`** component, use `pr.second`. For an example, see the sample code later in this article. @@ -772,7 +772,7 @@ No iterators or references are invalidated by this function. During emplacement, if an exception is thrown, the container's state isn't modified. -The [value_type](#value_type) of an element is a pair, so that the value of an element will be an ordered pair with the first component equal to the key value and the second component equal to the data value of the element. +The [`value_type`](#value_type) of an element is a pair, so that the value of an element will be an ordered pair with the first component equal to the key value and the second component equal to the data value of the element. ### Example @@ -830,7 +830,7 @@ int main() } ``` -## emplace_hint +## `emplace_hint` Inserts an element constructed in place (no copy or move operations are performed), with a placement hint. @@ -843,10 +843,10 @@ iterator emplace_hint( ### Parameters -*args*\ +*`args`*\ The arguments forwarded to construct an element to insert into the map unless the map already contains that element or, more generally, unless it already contains an element whose key is equivalently ordered. -*where*\ +*`where`*\ The place to start searching for the correct point of insertion. (If that point immediately precedes *where*, insertion can occur in amortized constant time instead of logarithmic time.) ### Return Value @@ -861,7 +861,7 @@ No iterators or references are invalidated by this function. During emplacement, if an exception is thrown, the container's state isn't modified. -The [value_type](#value_type) of an element is a pair, so that the value of an element will be an ordered pair with the first component equal to the key value and the second component equal to the data value of the element. +The [`value_type`](#value_type) of an element is a pair, so that the value of an element will be an ordered pair with the first component equal to the key value and the second component equal to the data value of the element. ### Example @@ -907,7 +907,7 @@ int main() } ``` -## empty +## `empty` Tests if a map is empty. @@ -952,7 +952,7 @@ The map m1 is not empty. The map m2 is empty. ``` -## end +## `end` Returns the past-the-end iterator. @@ -972,11 +972,11 @@ The past-the-end iterator. If the map is empty, then `map::end() == map::begin() The value returned by `end` should not be dereferenced. -For a code example, see [map::find](#find). +For a code example, see [`map::find`](#find). -## equal_range +## `equal_range` -Returns a pair of iterators that represent the [lower_bound](#lower_bound) of the key and the [upper_bound](#upper_bound) of the key. +Returns a pair of iterators that represent the [`lower_bound`](#lower_bound) of the key and the [`upper_bound`](#upper_bound) of the key. ```cpp pair equal_range (const Key& key) const; @@ -986,7 +986,7 @@ pair equal_range (const Key& key); ### Parameters -*key*\ +*`key`*\ The argument key value to be compared with the sort key of an element from the map being searched. ### Return Value @@ -1053,7 +1053,7 @@ matching the 2nd element of the pair returned by equal_range( 2 ). The map m1 doesn't have an element with a key less than 40. ``` -## erase +## `erase` Removes an element or a range of elements in a map from specified positions or removes elements that match a specified key. @@ -1071,16 +1071,16 @@ size_type erase( ### Parameters -*Where*\ +*`Where`*\ Position of the element to be removed. -*First*\ +*`First`*\ Position of the first element to be removed. -*Last*\ +*`Last`*\ Position just beyond the last element to be removed. -*Key*\ +*`Key`*\ The key value of the elements to be removed. ### Return Value @@ -1169,7 +1169,7 @@ int main() } ``` -## find +## `find` Returns an iterator that refers to the location of an element in a map that has a key equivalent to a specified key. @@ -1181,7 +1181,7 @@ const_iterator find(const Key& key) const; ### Parameters -*key*\ +*`key`*\ The key value to be matched by the sort key of an element from the map being searched. ### Return Value @@ -1256,7 +1256,7 @@ int main() } ``` -## get_allocator +## `get_allocator` Returns a copy of the allocator object used to construct the map. @@ -1326,7 +1326,7 @@ int main( ) } ``` -## insert +## `insert` Inserts an element or a range of elements into a map. @@ -1366,30 +1366,30 @@ IList); ### Parameters -*Val*\ +*`Val`*\ The value of an element to insert into the map unless it already contains an element whose key is equivalently ordered. -*Where*\ -The place to start searching for the correct point of insertion. (If that point immediately precedes *Where*, insertion can occur in amortized constant time instead of logarithmic time.) +*`Where`*\ +The place to start searching for the correct point of insertion. (If that point immediately precedes *`Where`*, insertion can occur in amortized constant time instead of logarithmic time.) -*ValTy*\ -Template parameter that specifies the argument type that the map can use to construct an element of [value_type](#value_type), and perfect-forwards *Val* as an argument. +*`ValTy`*\ +Template parameter that specifies the argument type that the map can use to construct an element of [`value_type`](#value_type), and perfect-forwards *`Val`* as an argument. -*First*\ +*`First`*\ The position of the first element to be copied. -*Last*\ +*`Last`*\ The position just beyond the last element to be copied. -*InputIterator*\ -Template function argument that meets the requirements of an [input iterator](../standard-library/input-iterator-tag-struct.md) that points to elements of a type that can be used to construct [value_type](#value_type) objects. +*`InputIterator`*\ +Template function argument that meets the requirements of an [input iterator](../standard-library/input-iterator-tag-struct.md) that points to elements of a type that can be used to construct [`value_type`](#value_type) objects. -*IList*\ -The [initializer_list](../standard-library/initializer-list.md) from which to copy the elements. +*`IList`*\ +The [`initializer_list`](../standard-library/initializer-list.md) from which to copy the elements. ### Return Value -The single-element member functions, (1) and (2), return a [pair](../standard-library/pair-structure.md) whose **`bool`** component is true if an insertion was made, and false if the map already contained an element whose key had an equivalent value in the ordering. The iterator component of the return-value pair points to the newly inserted element if the **`bool`** component is true, or to the existing element if the **`bool`** component is false. +The single-element member functions, (1) and (2), return a [`pair`](../standard-library/pair-structure.md) whose **`bool`** component is true if an insertion was made, and false if the map already contained an element whose key had an equivalent value in the ordering. The iterator component of the return-value pair points to the newly inserted element if the **`bool`** component is true, or to the existing element if the **`bool`** component is false. The single-element-with-hint member functions, (3) and (4), return an iterator that points to the position where the new element was inserted into the map or, if an element with an equivalent key already exists, to the existing element. @@ -1401,13 +1401,13 @@ During the insertion of just one element, if an exception is thrown, the contain To access the iterator component of a `pair` `pr` that's returned by the single-element member functions, use `pr.first`; to dereference the iterator within the returned pair, use `*pr.first`, giving you an element. To access the **`bool`** component, use `pr.second`. For an example, see the sample code later in this article. -The [value_type](#value_type) of a container is a typedef that belongs to the container, and for map, `map::value_type` is `pair`. The value of an element is an ordered pair in which the first component is equal to the key value and the second component is equal to the data value of the element. +The [`value_type`](#value_type) of a container is a typedef that belongs to the container, and for map, `map::value_type` is `pair`. The value of an element is an ordered pair in which the first component is equal to the key value and the second component is equal to the data value of the element. The range member function (5) inserts the sequence of element values into a map that corresponds to each element addressed by an iterator in the range `[First, Last)`; therefore, `Last` does not get inserted. The container member function `end()` refers to the position just after the last element in the container—for example, the statement `m.insert(v.begin(), v.end());` attempts to insert all elements of `v` into `m`. Only elements that have unique values in the range are inserted; duplicates are ignored. To observe which elements are rejected, use the single-element versions of `insert`. -The initializer list member function (6) uses an [initializer_list](../standard-library/initializer-list.md) to copy elements into the map. +The initializer list member function (6) uses an [`initializer_list`](../standard-library/initializer-list.md) to copy elements into the map. -For insertion of an element constructed in place—that is, no copy or move operations are performed—see [map::emplace](#emplace) and [map::emplace_hint](#emplace_hint). +For insertion of an element constructed in place—that is, no copy or move operations are performed—see [`map::emplace`](#emplace) and [`map::emplace_hint`](#emplace_hint). ### Example @@ -1507,7 +1507,7 @@ int main() } ``` -## iterator +## `iterator` A type that provides a bidirectional iterator that can read or modify any element in a map. @@ -1517,7 +1517,7 @@ typedef implementation-defined iterator; ### Remarks -The iterator defined by map points to elements that are objects of [value_type](#value_type), that is of type `pair`, whose first member is the key to the element and whose second member is the mapped datum held by the element. +The iterator defined by map points to elements that are objects of [`value_type`](#value_type), that is of type `pair`, whose first member is the key to the element and whose second member is the mapped datum held by the element. To dereference an iterator *Iter* pointing to an element in a map, use the `->` operator. @@ -1525,9 +1525,9 @@ To access the value of the key for the element, use `Iter->first`, which is equi ### Example -See example for [begin](#begin) for an example of how to declare and use `iterator`. +See example for [`begin`](#begin) for an example of how to declare and use `iterator`. -## key_comp +## `key_comp` Retrieves a copy of the comparison object used to order keys in a map. @@ -1598,7 +1598,7 @@ kc1( 2,3 ) returns value of true, where kc1 is the function object of m1. kc2( 2,3 ) returns value of false, where kc2 is the function object of m2. ``` -## key_compare +## `key_compare` A type that provides a function object that can compare two sort keys to determine the relative order of two elements in the `map`. @@ -1608,15 +1608,15 @@ typedef Traits key_compare; ### Remarks -`key_compare` is a synonym for the template parameter *Traits*. +`key_compare` is a synonym for the template parameter *`Traits`*. -For more information on *Traits*, see the [map Class](../standard-library/map-class.md) topic. +For more information on *`Traits`*, see the [`map` Class](../standard-library/map-class.md) topic. ### Example -See example for [key_comp](#key_comp) for an example of how to declare and use `key_compare`. +See example for [`key_comp`](#key_comp) for an example of how to declare and use `key_compare`. -## key_type +## `key_type` A type that describes the sort key stored in each element of the map. @@ -1626,15 +1626,15 @@ typedef Key key_type; ### Remarks -`key_type` is a synonym for the template parameter *Key*. +`key_type` is a synonym for the template parameter *`Key`*. -For more information on *Key*, see the Remarks section of the [map Class](../standard-library/map-class.md) topic. +For more information on *`Key`*, see the **Remarks** section of the [`map` Class](../standard-library/map-class.md) topic. ### Example -See example for [value_type](#value_type) for an example of how to declare and use `key_type`. +See example for [`value_type`](#value_type) for an example of how to declare and use `key_type`. -## lower_bound +## `lower_bound` Returns an iterator to the first element in a map with a key value that is equal to or greater than that of a specified key. @@ -1646,7 +1646,7 @@ const_iterator lower_bound(const Key& key) const; ### Parameters -*key*\ +*`key`*\ The argument key value to be compared with the sort key of an element from the map being searched. ### Return Value @@ -1705,7 +1705,7 @@ The map m1 doesn't have an element with a key of 4. The element of m1 with a key matching that of the last element is: 30. ``` -## map +## `map` Constructs a map that is empty or that is a copy of all or part of some other map. @@ -1758,39 +1758,39 @@ map( ### Parameters -*Al*\ +*`Al`*\ The storage allocator class to be used for this map object, which defaults to `Allocator`. -*Comp*\ +*`Comp`*\ The comparison function of type `const Traits` used to order the elements in the `map`, which defaults to `hash_compare`. -*Right*\ +*`Right`*\ The map of which the constructed set is to be a copy. -*First*\ +*`First`*\ The position of the first element in the range of elements to be copied. -*Last*\ +*`Last`*\ The position of the first element beyond the range of elements to be copied. -*IList*\ +*`IList`*\ The initializer_list from which the elements are to be copied. ### Remarks -All constructors store a type of allocator object that manages memory storage for the map and that can later be returned by calling [get_allocator](#get_allocator). The allocator parameter is often omitted in the class declarations and preprocessing macros used to substitute alternative allocators. +All constructors store a type of allocator object that manages memory storage for the map and that can later be returned by calling [`get_allocator`](#get_allocator). The allocator parameter is often omitted in the class declarations and preprocessing macros used to substitute alternative allocators. All constructors initialize their map. -All constructors store a function object of type Traits that is used to establish an order among the keys of the map and that can later be returned by calling [key_comp](#key_comp). +All constructors store a function object of type Traits that is used to establish an order among the keys of the map and that can later be returned by calling [`key_comp`](#key_comp). -The first three constructors specify an empty initial map, the second specifying the type of comparison function (*Comp*) to be used in establishing the order of the elements and the third explicitly specifying the allocator type (*Al*) to be used. The key word **`explicit`** suppresses certain kinds of automatic type conversion. +The first three constructors specify an empty initial map, the second specifying the type of comparison function (*`Comp`*) to be used in establishing the order of the elements and the third explicitly specifying the allocator type (*`Al`*) to be used. The key word **`explicit`** suppresses certain kinds of automatic type conversion. -The fourth constructor specifies a copy of the map *Right*. +The fourth constructor specifies a copy of the map *`Right`*. -The fifth constructor specifies a copy of the map by moving *Right*. +The fifth constructor specifies a copy of the map by moving *`Right`*. -The 6th, 7th, and 8th constructors use an initializer_list from which to copy the members. +The 6th, 7th, and 8th constructors use an `initializer_list` from which to copy the members. The next three constructors copy the range `[First, Last)` of a map with increasing explicitness in specifying the type of comparison function of class `Traits` and allocator. @@ -1910,7 +1910,7 @@ int main() } ``` -## mapped_type +## `mapped_type` A type that represents the data stored in a map. @@ -1922,13 +1922,13 @@ typedef Type mapped_type; The type `mapped_type` is a synonym for the class's *Type* template parameter. -For more information on *Type*, see the [map Class](../standard-library/map-class.md) topic. +For more information on *`Type`*, see the [`map` Class](../standard-library/map-class.md) topic. ### Example -See example for [value_type](#value_type) for an example of how to declare and use `mapped_type`. +See example for [`value_type`](#value_type) for an example of how to declare and use `mapped_type`. -## max_size +## `max_size` Returns the maximum length of the map. @@ -1961,7 +1961,7 @@ int main( ) } ``` -## operator[] +## `operator[]` Inserts an element into a map with a specified key value. @@ -1973,7 +1973,7 @@ Type& operator[](Key&& key); ### Parameters -*key*\ +*`key`*\ The key value of the element that is to insert. ### Return Value @@ -1984,9 +1984,9 @@ A reference to the data value of the inserted element. If the argument key value isn't found, then it is inserted along with the default value of the data type. -`operator[]` may be used to insert elements into a map `m` using `m[key] = DataValue;` where `DataValue` is the value of the `mapped_type` of the element with a key value of *key*. +`operator[]` may be used to insert elements into a map `m` using `m[key] = DataValue;` where `DataValue` is the value of the `mapped_type` of the element with a key value of *`key`*. -When using `operator[]` to insert elements, the returned reference does not indicate whether an insertion is changing a pre-existing element or creating a new one. The member functions [find](#find) and [insert](#insert) can be used to determine whether an element with a specified key is already present before an insertion. +When using `operator[]` to insert elements, the returned reference does not indicate whether an insertion is changing a pre-existing element or creating a new one. The member functions [`find`](#find) and [`insert`](#insert) can be used to determine whether an element with a specified key is already present before an insertion. ### Example @@ -2059,7 +2059,7 @@ c2[move(str)] == 0 c2["abc"] == 1 ``` -## operator= +## `operator=` Replaces the elements of a map with a copy of another map. @@ -2070,12 +2070,12 @@ map& operator=(map&& right); ### Parameters -*right*\ -The [map](../standard-library/map-class.md) being copied into the `map`. +*`right`*\ +The [`map`](../standard-library/map-class.md) being copied into the `map`. ### Remarks -After erasing any existing elements in a `map`, `operator=` either copies or moves the contents of *right* into the map. +After erasing any existing elements in a `map`, `operator=` either copies or moves the contents of *`right`* into the map. ### Example @@ -2114,7 +2114,7 @@ int main( ) } ``` -## pointer +## `pointer` A type that provides a pointer to an element in a map. @@ -2126,7 +2126,7 @@ typedef typename allocator_type::pointer pointer; A type `pointer` can be used to modify the value of an element. -In most cases, an [iterator](#iterator) should be used to access the elements in a map object. +In most cases, an [`iterator`](#iterator) should be used to access the elements in a map object. ## rbegin @@ -2144,7 +2144,7 @@ A reverse bidirectional iterator addressing the first element in a reversed map ### Remarks -`rbegin` is used with a reversed map just as [begin](#begin) is used with a map. +`rbegin` is used with a reversed map just as [`begin`](#begin) is used with a map. If the return value of `rbegin` is assigned to a `const_reverse_iterator`, then the map object can't be modified. If the return value of `rbegin` is assigned to a `reverse_iterator`, then the map object can be modified. @@ -2208,7 +2208,7 @@ The reversed map is: 3 2 1 . After the erasure, the first element in the reversed map is 2. ``` -## reference +## `reference` A type that provides a reference to an element stored in a map. @@ -2265,7 +2265,7 @@ The data value of first element in the map is 10. The modified data value of first element is 15. ``` -## rend +## `rend` Returns an iterator that addresses the location succeeding the last element in a reversed map. @@ -2281,7 +2281,7 @@ A reverse bidirectional iterator that addresses the location succeeding the last ### Remarks -`rend` is used with a reversed map just as [end](#end) is used with a map. +`rend` is used with a reversed map just as [`end`](#end) is used with a map. If the return value of `rend` is assigned to a `const_reverse_iterator`, then the map object can't be modified. If the return value of `rend` is assigned to a `reverse_iterator`, then the map object can be modified. @@ -2349,7 +2349,7 @@ The reversed map is: 3 2 1 . After the erasure, the last element in the reversed map is 2. ``` -## reverse_iterator +## `reverse_iterator` A type that provides a bidirectional iterator that can read or modify an element in a reversed map. @@ -2361,7 +2361,7 @@ typedef std::reverse_iterator reverse_iterator; A type `reverse_iterator` can't modify the value of an element and is used to iterate through the map in reverse. -The `reverse_iterator` defined by map points to elements that are objects of [value_type](#value_type), that is of type `pair`, whose first member is the key to the element and whose second member is the mapped datum held by the element. +The `reverse_iterator` defined by map points to elements that are objects of [`value_type`](#value_type), that is of type `pair`, whose first member is the key to the element and whose second member is the mapped datum held by the element. To dereference a `reverse_iterator` *rIter* pointing to an element in a map, use the `->` operator. @@ -2369,9 +2369,9 @@ To access the value of the key for the element, use `rIter` -> **first**, which ### Example -See example for [rbegin](#rbegin) for an example of how to declare and use `reverse_iterator`. +See example for [`rbegin`](#rbegin) for an example of how to declare and use `reverse_iterator`. -## size +## `size` Returns the number of elements in the `map`. @@ -2385,7 +2385,7 @@ The current length of the map. ### Example -The following example demonstrates the use of the map::size member function. +The following example demonstrates the use of the `map::size` member function. ```cpp // map_size.cpp @@ -2415,7 +2415,7 @@ The map length is 1. The map length is now 2. ``` -## size_type +## `size_type` An unsigned integer type that can represent the number of elements in a map. @@ -2425,7 +2425,7 @@ typedef typename allocator_type::size_type size_type; ### Example -See the example for [size](#size) for an example of how to declare and use `size_type`. +See the example for [`size`](#size) for an example of how to declare and use `size_type`. ## swap @@ -2438,7 +2438,7 @@ void swap( ### Parameters -*right*\ +*`right`*\ The argument map providing the elements to be swapped with the target map. ### Remarks @@ -2497,7 +2497,7 @@ After swapping with m2, map m1 is: 100 200. After swapping with m3, map m1 is: 300. ``` -## upper_bound +## `upper_bound` Returns an iterator to the first element in a map that with a key having a value that is greater than that of a specified key. @@ -2509,7 +2509,7 @@ const_iterator upper_bound(const Key& key) const; ### Parameters -*key*\ +*`key`*\ The argument key value to be compared with the sort key value of an element from the map being searched. ### Return Value @@ -2569,7 +2569,7 @@ The 1st element of m1 with a key greater than that of the initial element of m1 is: 20. ``` -## value_comp +## `value_comp` The member function returns a function object that determines the order of elements in a map by comparing their key values. @@ -2637,7 +2637,7 @@ The element ( 1,10 ) precedes the element ( 2,5 ). The element ( 2,5 ) does not precede the element ( 1,10 ). ``` -## value_type +## `value_type` The type of object stored as an element in a map. diff --git a/docs/standard-library/overloading-the-input-operator-for-your-own-classes.md b/docs/standard-library/overloading-the-input-operator-for-your-own-classes.md index 32e9ad7c517..99c3d3824af 100644 --- a/docs/standard-library/overloading-the-input-operator-for-your-own-classes.md +++ b/docs/standard-library/overloading-the-input-operator-for-your-own-classes.md @@ -5,7 +5,7 @@ ms.date: "11/04/2016" helpviewer_keywords: ["operator>>", "operator>>, overloading for your own classes", "operator >>, overloading for your own classes"] ms.assetid: 40dab4e0-3f97-4745-9cc8-b86e740fa246 --- -# Overloading the >> Operator for Your Own Classes +# Overloading the `>>` Operator for Your Own Classes Input streams use the extraction (`>>`) operator for the standard types. You can write similar extraction operators for your own types; your success depends on using white space precisely. diff --git a/docs/standard-library/overloading-the-output-operator-for-your-own-classes.md b/docs/standard-library/overloading-the-output-operator-for-your-own-classes.md index a6b71829f78..f187ac26396 100644 --- a/docs/standard-library/overloading-the-output-operator-for-your-own-classes.md +++ b/docs/standard-library/overloading-the-output-operator-for-your-own-classes.md @@ -5,7 +5,7 @@ ms.date: "11/04/2016" helpviewer_keywords: ["operator<<, overloading for your own classes", "operator <<, overloading for your own classes"] ms.assetid: ad1d2c49-d84e-48a8-9c09-121f28b10bf0 --- -# Overloading the << Operator for Your Own Classes +# Overloading the `<<` Operator for Your Own Classes Output streams use the insertion (`<<`) operator for standard types. You can also overload the `<<` operator for your own classes. diff --git a/docs/standard-library/vector-class.md b/docs/standard-library/vector-class.md index 8285ea82ded..94f797a3616 100644 --- a/docs/standard-library/vector-class.md +++ b/docs/standard-library/vector-class.md @@ -32,7 +32,7 @@ Vector reallocation occurs when a member function must increase the sequence con The [`vector` class](../standard-library/vector-bool-class.md) is a full specialization of the class template vector for elements of type **`bool`**. It has an allocator for the underlying type used by the specialization. -The [`vector` reference class](../standard-library/vector-bool-class.md#reference_class) is a nested class whose objects can provide references to elements (single bits) within a vector\ object. +The [`vector` reference class](../standard-library/vector-bool-class.md#reference_class) is a nested class whose objects can provide references to elements (single bits) within a `vector` object. ## Members