Skip to content

Commit 7915983

Browse files
committed
Use 'std::tuple' in examples instead of a C array
This should be clearer since C arrays *are* ranges; it's just that the standard specifically excludes array types from being expansion-iterable; it should be a bit more obvious that this is supposed to be destructuring if we use 'std::tuple' as an example.
1 parent 8437f22 commit 7915983

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/include/clang/AST/DeclTemplate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3375,7 +3375,7 @@ class TemplateParamObjectDecl : public ValueDecl,
33753375
///
33763376
/// For example, if the user writes the following expansion statement:
33773377
/// \verbatim
3378-
/// int a[3]{1, 2, 3};
3378+
/// std::tuple<int, int, int> a{1, 2, 3};
33793379
/// template for (auto x : a) {
33803380
/// // ...
33813381
/// }

clang/include/clang/AST/StmtCXX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ class CXXDestructuringExpansionStmt : public CXXExpansionStmt {
897897
/// following expansion statement
898898
///
899899
/// \verbatim
900-
/// int a[3]{1, 2, 3};
900+
/// std::tuple<int, int, int> a{1, 2, 3};
901901
/// template for (auto x : a) {
902902
/// // ...
903903
/// }

0 commit comments

Comments
 (0)