-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand in-place
tags page
#4753
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
description: "Learn more about: in_place_t Struct, in_place_type_t Struct, in_place_index_t Struct" | ||
title: "in_place_t Struct, in_place_type_t Struct, in_place_index_t Struct" | ||
ms.date: "11/04/2016" | ||
f1_keywords: ["utility<in_place_t>", "utility/std::in_place_t", "utility<in_place_type_t>", "utility/std::in_place_type_t", "utility<in_place_index_t>", "utility/std::in_place_index_t"] | ||
helpviewer_keywords: ["utility<in_place_t> struct"] | ||
--- | ||
# in_place_t Struct, in_place_type_t Struct, in_place_index_t Struct | ||
|
||
The empty structure type `in_place_t` can be passed into constructors of `expected` class, [`optional` class](optional-class.md) or [`single_view` class](single-view-class.md) for in-place construction of the contained type. The empty structure type `in_place_type_t` can be passed into constructors of [`any` class](any-class.md) or [`variant` class](variant-class.md) to specify the type of the object. The empty structure type `in_place_index_t` can be passed into constructors of [`variant` class](variant-class.md) to specify the index of the object. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Weren't these introduced in C++17? We should tag them as such and indicate that they should use at least There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This says where we can pass them, but not why. |
||
|
||
## Syntax | ||
|
||
```cpp | ||
struct in_place_t { | ||
explicit in_place_t() = default; | ||
}; | ||
|
||
inline constexpr in_place_t in_place{}; | ||
|
||
template <class T> | ||
struct in_place_type_t { | ||
explicit in_place_type_t() = default; | ||
}; | ||
|
||
template <class T> | ||
inline constexpr in_place_type_t<T> in_place_type{}; | ||
|
||
template <size_t I> | ||
struct in_place_index_t { | ||
explicit in_place_index_t() = default; | ||
}; | ||
|
||
template <size_t I> | ||
inline constexpr in_place_index_t<I> in_place_index{}; | ||
``` |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ Pairs are widely used in the C++ Standard Library. They are required both as the | |
|-|-| | ||
|[from_chars_result](../standard-library/from-chars-result-structure.md)|A struct used for `from_chars`.| | ||
|[identity](../standard-library/identity-structure.md)|A struct that provides a type definition as the template parameter.| | ||
|[in_place_t](../standard-library/in-place-t-struct.md)|Also includes structs `in_place_type_t` and `in_place_index_t`.| | ||
|[in_place_t, in_place_type_t, in_place_index_t](../standard-library/in-place-t-struct-in-place-type-t-struct-in-place-index-t-struct.md)|Types used to control in-place construction.| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please code escape. I know that this file hasn't been doing that. Many of these were written before we realized what was going on with machine translation, so when we touch a file we code escape functions, types, etc. |
||
|[integer_sequence](../standard-library/integer-sequence-class.md)|Represents an integer sequence.| | ||
|[pair](../standard-library/pair-structure.md)|A type that provides for the ability to treat two objects as a single object.| | ||
|[piecewise_construct_t](../standard-library/piecewise-construct-t-structure.md)|A type used to keep separate constructor and function overloading.| | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please code escape. Otherwise, auto machine translation may have modify these