Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
881928a
updates for VS2019
May 14, 2019
e0b8126
versioning applied to tools and features topic
May 14, 2019
f749cae
added vcpkg
May 14, 2019
8e7b093
fixed links
May 14, 2019
591a665
attempt to avoid H1 error
May 15, 2019
6cf74c7
experimenting with versioned include files
May 15, 2019
3e48ff4
put both versions back into parent topic
May 16, 2019
9a36528
fixed link
May 16, 2019
cde0ee8
fixed table
May 16, 2019
e44863e
fixed title and metadata
May 16, 2019
deb05c0
fixed H1
May 16, 2019
63d9a88
Address issue 1012 on default libraries
May 17, 2019
614aeb7
Merge branch 'master' into mb-overview
May 19, 2019
6a20558
in progress edits
May 19, 2019
dc67992
more casey and billy comments addressed
May 20, 2019
4090a61
applied more partial ordering for tables
May 20, 2019
e73fd98
reverted bad commit and added my good changes
May 20, 2019
918f592
fixed merge conflict
May 20, 2019
0ed99e0
updates for VS2019
May 20, 2019
8880569
removed note_F and changed date
May 20, 2019
9d31b0b
added pendantic clause from casey
May 20, 2019
de89f63
Merge pull request #2025 from mikeblome/mb-conform2
PRMerger15 May 20, 2019
8b4a38e
reworked vs2019 section
May 21, 2019
087484f
reordered section and added 2.o for openmp
May 21, 2019
7c8f9d7
updated for enterprise only features
May 21, 2019
9bf0582
C87716: Fixing bookmark
v-makoud May 21, 2019
b09aaaf
C87718: Fixing bookmark
v-makoud May 21, 2019
ad16420
C87718: Fixing bookmarks
v-makoud May 21, 2019
6544a0e
C87718: Fixing bookmarks
v-makoud May 21, 2019
293a640
C87724: Fixing bookmark
v-makoud May 21, 2019
54d3dcc
C87725: Fixing bookmark
v-makoud May 21, 2019
94cdf78
Merge pull request #2027 from v-makoud/patch-6
PRMerger17 May 21, 2019
9b757f1
Merge pull request #2028 from v-makoud/patch-7
PRMerger18 May 21, 2019
93ee422
Merge pull request #2029 from v-makoud/patch-8
PRMerger18 May 21, 2019
8a27386
Merge pull request #2030 from v-makoud/patch-9
PRMerger18 May 21, 2019
3c94642
Merge pull request #2031 from v-makoud/patch-10
PRMerger18 May 21, 2019
ec9ade0
Merge pull request #2032 from v-makoud/patch-11
PRMerger18 May 21, 2019
a61d17c
Merge pull request #2033 from MicrosoftDocs/master
Taojunshen May 21, 2019
f950ac3
added enterprise-only to Intellitrace
May 21, 2019
80c95a2
updated image and tweaked overview topic
May 21, 2019
a663537
fixed casing on settting
May 21, 2019
9dd821d
attempt to fix image indentation inside version monikers
May 21, 2019
52de7d4
Merge pull request #2034 from mikeblome/mb-prebuild2
PRMerger16 May 21, 2019
6a89ecd
Merge pull request #2008 from mikeblome/mb-overview
American-Dipper May 21, 2019
e281029
Address issue 1022
May 21, 2019
7f4aae6
Merge pull request #2035 from corob-msft/cr-fix-1022
PRMerger8 May 21, 2019
9c9dd1b
Update numbers of max lowio and stdio files
May 22, 2019
0bcb3ed
Acrolinx all the things.
May 22, 2019
fc10ddc
Merge pull request #2036 from corob-msft/cr-fix-1020
ktoliver May 22, 2019
699dd88
Another wording tweak
May 22, 2019
8dbcc2f
Merge pull request #2023 from corob-msft/cr-fix-1012
ktoliver May 22, 2019
997ba65
Revert "C87721: Fixing bookmarks"
May 22, 2019
e852ee0
Restore internationalizable anchor tags
May 22, 2019
4a82b76
Revert "C87724: Fixing bookmark"
May 22, 2019
6d59aff
Restore internationalizable anchor link
May 22, 2019
9816fbe
Merge pull request #2037 from MicrosoftDocs/revert-2030-patch-9
PRMerger7 May 22, 2019
2dfb21b
Merge pull request #2038 from MicrosoftDocs/revert-2031-patch-10
PRMerger8 May 22, 2019
e0f940b
Adapt and adopt PR 988 solution
May 22, 2019
14b5769
Fix up date, Acrolinx all the things
May 22, 2019
986d842
Acrolinx more things
May 22, 2019
41bb720
Add .vscode directory to .gitignore
May 22, 2019
b999616
Merge pull request #2040 from corob-msft/update-gitignore
May 22, 2019
acb1af5
Merge pull request #2039 from corob-msft/cr-adapt-988
GitHubber17 May 22, 2019
bde3279
Merge pull request #2041 from MicrosoftDocs/master
Taojunshen May 23, 2019
e91ecda
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs…
opbld15 May 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ _themes.MSDN.Modern/
_themes.VS.Modern/

.openpublishing.buildcore.ps1
.vscode/

# Documentation build
/docs/vcppdocs
Binary file modified docs/build/media/mathclient-project-name-2019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/c-runtime-library/reference/open-osfhandle.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "_open_osfhandle"
ms.date: "05/29/2018"
ms.date: "05/21/2019"
apiname: ["_open_osfhandle"]
apilocation: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-stdio-l1-1-0.dll"]
apitype: "DLLExport"
Expand Down Expand Up @@ -46,7 +46,7 @@ These manifest constants are defined in \<fcntl.h>:
| **\_O\_TEXT** | Opens the file in text (translated) mode. |
| **\_O\_WTEXT** | Opens the file in Unicode (translated UTF-16) mode. |

The **_open_osfhandle** call transfers ownership of the Win32 file handle to the file descriptor. To close a file opened with **_open_osfhandle**, call [\_close](close.md). The underlying OS file handle is also closed by a call to **_close**, so it is not necessary to call the Win32 function **CloseHandle** on the original handle. If the file descriptor is owned by a **FILE &#42;** stream, then calling [fclose](fclose-fcloseall.md) on that **FILE &#42;** stream also closes both the file descriptor and the underlying handle. In this case, do not call **_close** on the file descriptor.
The **_open_osfhandle** call transfers ownership of the Win32 file handle to the file descriptor. To close a file opened by using **_open_osfhandle**, call [\_close](close.md). The underlying OS file handle is also closed by a call to **_close**. Don't call the Win32 function **CloseHandle** on the original handle. If the file descriptor is owned by a **FILE &#42;** stream, then a call to [fclose](fclose-fcloseall.md) on that **FILE &#42;** stream closes both the file descriptor and the underlying handle. In this case, don't call **_close** on the file descriptor or **CloseHandle** on the original handle.

## Requirements

Expand Down
22 changes: 11 additions & 11 deletions docs/c-runtime-library/reference/setmaxstdio.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "_setmaxstdio"
ms.date: "11/04/2016"
ms.date: "05/21/2019"
apiname: ["_setmaxstdio"]
apilocation: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-stdio-l1-1-0.dll"]
apitype: "DLLExport"
Expand All @@ -10,39 +10,39 @@ ms.assetid: 9e966875-9ff5-47c4-9b5f-e79e83b70249
---
# _setmaxstdio

Sets a maximum for the number of simultaneously open files at the **stdio** level.
Sets a maximum for the number of simultaneously open files at the stream I/O level.

## Syntax

```C
int _setmaxstdio(
int newmax
int new_max
);
```

### Parameters

*newmax*<br/>
New maximum for the number of simultaneously open files at the **stdio** level.
*new_max*<br/>
New maximum for the number of simultaneously open files at the stream I/O level.

## Return Value

Returns *newmax* if successful; -1 otherwise.
Returns *new_max* if successful; -1 otherwise.

If *newmax* is less than **_IOB_ENTRIES** or greater then the maximum number of handles available in the operating system, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns -1 and sets **errno** to **EINVAL**.
If *new_max* is less than **_IOB_ENTRIES**, or greater than the maximum number of handles available in the operating system, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns -1 and sets **errno** to **EINVAL**.

For information about these and other error codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).

## Remarks

The **_setmaxstdio** function changes the maximum value for the number of files that might be simultaneously open at the **stdio** level.
The **_setmaxstdio** function changes the maximum value for the number of files that may be open simultaneously at the stream I/O level.

C run-time I/O now supports many more open files on Win32 platforms than in previous versions. Up to 2,048 files can be open simultaneously at the [lowio level](../../c-runtime-library/low-level-i-o.md) (that is, opened and accessed by means of the **_open**, **_read**, **_write**, and so forth family of I/O functions). Up to 512 files can be open simultaneously at the [stdio level](../../c-runtime-library/stream-i-o.md) (that is, opened and accessed by means of the **fopen**, **fgetc**, **fputc**, and so forth family of functions). The limit of 512 open files at the **stdio** level can be increased to a maximum of 2,048 by means of the **_setmaxstdio** function.
C run-time I/O now supports up to 8,192 files open simultaneously at the [low I/O level](../../c-runtime-library/low-level-i-o.md). This level includes files opened and accessed using the **_open**, **_read**, and **_write** family of I/O functions. By default, up to 512 files can be open simultaneously at the [stream I/O level](../../c-runtime-library/stream-i-o.md). This level includes files opened and accessed using the **fopen**, **fgetc**, and **fputc** family of functions. The limit of 512 open files at the stream I/O level can be increased to a maximum of 8,192 by use of the **_setmaxstdio** function.

Because **stdio**-level functions, such as **fopen**, are built on top of the **lowio** functions, the maximum of 2,048 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library.
Because stream I/O-level functions, such as **fopen**, are built on top of the low I/O-level functions, the maximum of 8,192 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library.

> [!NOTE]
> This upper limit might be beyond what is supported by a particular Win32 platform and configuration.
> This upper limit might be beyond what's supported by a particular Win32 platform and configuration.

## Requirements

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
vector<shared_ptr<Song>> v {
make_shared<Song>(L"Bob Dylan", L"The Times They Are A Changing"),
make_shared<Song>(L"Aretha Franklin", L"Bridge Over Troubled Water"),
make_shared<Song>(L"Thal�a", L"Entre El Mar y Una Estrella")
make_shared<Song>(L"Thalía", L"Entre El Mar y Una Estrella")
};

vector<shared_ptr<Song>> v2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
vector<shared_ptr<MediaAsset>> assets {
make_shared<Song>(L"Himesh Reshammiya", L"Tera Surroor"),
make_shared<Song>(L"Penaz Masani", L"Tu Dil De De")),
make_shared<Song>(L"Penaz Masani", L"Tu Dil De De"),
make_shared<Photo>(L"2011-04-06", L"Redmond, WA", L"Soccer field at Microsoft.")
};

Expand All @@ -18,5 +18,5 @@
{
// We know that the photos vector contains only
// shared_ptr<Photo> objects, so use static_cast.
wcout << "Photo location: " << (static_pointer_cast<Photo>(p))->location_ << endl;
wcout << "Photo location: " << (static_pointer_cast<Photo>(p))->location << endl;
}
69 changes: 60 additions & 9 deletions docs/cpp/how-to-create-and-use-shared-ptr-instances.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "How to: Create and Use shared_ptr Instances"
ms.custom: "how-to"
ms.date: "11/19/2018"
ms.date: "05/22/2019"
ms.topic: "conceptual"
ms.assetid: 7d6ebb73-fa0d-4b0b-a528-bf05de96518e
---
Expand All @@ -13,9 +13,60 @@ The following illustration shows several `shared_ptr` instances that point to on

![Shared pointer diagram](../cpp/media/shared_ptr.png "Shared pointer diagram")

## Example setup

The examples that follow all assume that you've included the required headers and declared the required types, as shown here:

```cpp
// shared_ptr-examples.cpp
// The following examples assume these declarations:
#include <algorithm>
#include <iostream>
#include <memory>
#include <string>
#include <vector>

struct MediaAsset
{
virtual ~MediaAsset() = default; // make it polymorphic
};

struct Song : public MediaAsset
{
std::wstring artist;
std::wstring title;
Song(const std::wstring& artist_, const std::wstring& title_) :
artist{ artist_ }, title{ title_ } {}
};

struct Photo : public MediaAsset
{
std::wstring date;
std::wstring location;
std::wstring subject;
Photo(
const std::wstring& date_,
const std::wstring& location_,
const std::wstring& subject_) :
date{ date_ }, location{ location_ }, subject{ subject_ } {}
};

using namespace std;

int main()
{
// The examples go here, in order:
// Example 1
// Example 2
// Example 3
// Example 4
// Example 6
}
```

## Example 1

Whenever possible, use the [make_shared](../standard-library/memory-functions.md#make_shared) function to create a `shared_ptr` when the memory resource is created for the first time. `make_shared` is exception-safe. It uses the same call to allocate the memory for the control block and the resource, and thereby reduces the construction overhead. If you do not use `make_shared`, then you have to use an explicit new expression to create the object before you pass it to the `shared_ptr` constructor. The following example shows various ways to declare and initialize a `shared_ptr` together with a new object.
Whenever possible, use the [make_shared](../standard-library/memory-functions.md#make_shared) function to create a `shared_ptr` when the memory resource is created for the first time. `make_shared` is exception-safe. It uses the same call to allocate the memory for the control block and the resource, which reduces the construction overhead. If you don't use `make_shared`, then you have to use an explicit `new` expression to create the object before you pass it to the `shared_ptr` constructor. The following example shows various ways to declare and initialize a `shared_ptr` together with a new object.

[!code-cpp[stl_smart_pointers#1](../cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_1.cpp)]

Expand All @@ -27,7 +78,7 @@ The following example shows how to declare and initialize `shared_ptr` instances

## Example 3

`shared_ptr` is also helpful in C++ Standard Library containers when you are using algorithms that copy elements. You can wrap elements in a `shared_ptr`, and then copy it into other containers with the understanding that the underlying memory is valid as long as you need it, and no longer. The following example shows how to use the `replace_copy_if` algorithm on `shared_ptr` instances in a vector.
`shared_ptr` is also helpful in C++ Standard Library containers when you're using algorithms that copy elements. You can wrap elements in a `shared_ptr`, and then copy it into other containers with the understanding that the underlying memory is valid as long as you need it, and no longer. The following example shows how to use the `replace_copy_if` algorithm on `shared_ptr` instances in a vector.

[!code-cpp[stl_smart_pointers#4](../cpp/codesnippet/CPP/how-to-create-and-use-shared-ptr-instances_3.cpp)]

Expand All @@ -41,17 +92,17 @@ You can use `dynamic_pointer_cast`, `static_pointer_cast`, and `const_pointer_ca

You can pass a `shared_ptr` to another function in the following ways:

- Pass the `shared_ptr` by value. This invokes the copy constructor, increments the reference count, and makes the callee an owner. There is a small amount of overhead in this operation, which may be significant depending on how many `shared_ptr` objects you are passing. Use this option when the code contract (implied or explicit) between the caller and callee requires that the callee be an owner.
- Pass the `shared_ptr` by value. This invokes the copy constructor, increments the reference count, and makes the callee an owner. There's a small amount of overhead in this operation, which may be significant depending on how many `shared_ptr` objects you're passing. Use this option when the implied or explicit code contract between the caller and callee requires that the callee be an owner.

- Pass the `shared_ptr` by reference or const reference. In this case, the reference count is not incremented, and the callee can access the pointer as long as the caller does not go out of scope. Or, the callee can decide to create a `shared_ptr` based on the reference, and thereby become a shared owner. Use this option when the caller has no knowledge of the callee, or when you must pass a `shared_ptr` and want to avoid the copy operation for performance reasons.
- Pass the `shared_ptr` by reference or const reference. In this case, the reference count isn't incremented, and the callee can access the pointer as long as the caller doesn't go out of scope. Or, the callee can decide to create a `shared_ptr` based on the reference, and become a shared owner. Use this option when the caller has no knowledge of the callee, or when you must pass a `shared_ptr` and want to avoid the copy operation for performance reasons.

- Pass the underlying pointer or a reference to the underlying object. This enables the callee to use the object, but does not enable it to share ownership or extend the lifetime. If the callee creates a `shared_ptr` from the raw pointer, the new `shared_ptr` is independent from the original, and does not control the underlying resource. Use this option when the contract between the caller and callee clearly specifies that the caller retains ownership of the `shared_ptr` lifetime.
- Pass the underlying pointer or a reference to the underlying object. This enables the callee to use the object, but doesn't enable it to share ownership or extend the lifetime. If the callee creates a `shared_ptr` from the raw pointer, the new `shared_ptr` is independent from the original, and doesn't control the underlying resource. Use this option when the contract between the caller and callee clearly specifies that the caller retains ownership of the `shared_ptr` lifetime.

- When you are deciding how to pass a `shared_ptr`, determine whether the callee has to share ownership of the underlying resource. An "owner" is an object or function that can keep the underlying resource alive for as long as it needs it. If the caller has to guarantee that the callee can extend the life of the pointer beyond its (the function's) lifetime, use the first option. If you don't care whether the callee extends the lifetime, then pass by reference and let the callee copy it or not.
- When you're deciding how to pass a `shared_ptr`, determine whether the callee has to share ownership of the underlying resource. An "owner" is an object or function that can keep the underlying resource alive for as long as it needs it. If the caller has to guarantee that the callee can extend the life of the pointer beyond its (the function's) lifetime, use the first option. If you don't care whether the callee extends the lifetime, then pass by reference and let the callee copy it or not.

- If you have to give a helper function access to the underlying pointer, and you know that the helper function will just use the pointer and return before the calling function returns, then that function does not have to share ownership of the underlying pointer. It just has to access the pointer within the lifetime of the caller's `shared_ptr`. In this case, it is safe to pass the `shared_ptr` by reference, or pass the raw pointer or a reference to the underlying object. Passing this way provides a small performance benefit, and may also help you express your programming intent.
- If you have to give a helper function access to the underlying pointer, and you know that the helper function will just use the pointer and return before the calling function returns, then that function doesn't have to share ownership of the underlying pointer. It just has to access the pointer within the lifetime of the caller's `shared_ptr`. In this case, it's safe to pass the `shared_ptr` by reference, or pass the raw pointer or a reference to the underlying object. Passing this way provides a small performance benefit, and may also help you express your programming intent.

- Sometimes, for example in a `std:vector<shared_ptr<T>>`, you may have to pass each `shared_ptr` to a lambda expression body or named function object. If the lambda or function is not storing the pointer, then pass the `shared_ptr` by reference to avoid invoking the copy constructor for each element.
- Sometimes, for example in a `std:vector<shared_ptr<T>>`, you may have to pass each `shared_ptr` to a lambda expression body or named function object. If the lambda or function doesn't store the pointer, then pass the `shared_ptr` by reference to avoid invoking the copy constructor for each element.

## Example 6

Expand Down
6 changes: 3 additions & 3 deletions docs/linux/cmake-linux-project.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Configure a Linux CMake project in Visual Studio"
description: "How to configure, edit and compile a Linux CMake project in Visual Studio"
ms.date: "05/03/2019"
ms.date: "05/21/2019"
ms.assetid: f8707b32-f90d-494d-ae0b-1d44425fdc25
---

Expand Down Expand Up @@ -147,9 +147,9 @@ You can use these optional settings for more control:

```json
{
"remotePreBuildCommand": "",
"remotePrebuildCommand": "",
"remotePreGenerateCommand": "",
"remotePostBuildCommand": "",
"remotePostbuildCommand": "",
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/mfc/reference/message-map-macros-mfc.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ END_MESSAGE_MAP()

**Header:** afxwin.h

## BEGIN_TEMPLATE_MESSAGE_MAP
## <a name="begin_template_message_map"></a> BEGIN_TEMPLATE_MESSAGE_MAP

Begins the definition of a message map on a class type containing a single template argument.

Expand Down
8 changes: 4 additions & 4 deletions docs/mfc/reference/run-time-object-model-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Determines whether the Common Controls library implements the specified API.

### Syntax

```
```
AFX_COMCTL32_IF_EXISTS( proc );
```

Expand Down Expand Up @@ -158,7 +158,7 @@ See the example for [IMPLEMENT_DYNCREATE](#implement_dyncreate).

**Header:** afx.h

## DECLARE_OLECTLTYPE
## <a name="declare_olectltype"></a> DECLARE_OLECTLTYPE

Declares the `GetUserTypeNameID` and `GetMiscStatus` member functions of your control class.

Expand All @@ -181,7 +181,7 @@ The name of the control class.

**Header:** afxctl.h

## DECLARE_PROPPAGEIDS
## <a name="declare_proppageids"></a> DECLARE_PROPPAGEIDS

Declares that the OLE control provides a list of property pages to display its properties.

Expand Down Expand Up @@ -355,7 +355,7 @@ The OLE class ID is a unique 128-bit identifier for the object. It consists of o

**Header:** afxdisp.h

## IMPLEMENT_OLECTLTYPE
## <a name="implement_olectltype"></a> IMPLEMENT_OLECTLTYPE

Implements the `GetUserTypeNameID` and `GetMiscStatus` member functions of your control class.

Expand Down
Loading