Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions src/content/docs/cpp/language/basics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: Overview
sidebar:
order: 1
cppdoc:
keys: ["cpp.lang.basic"]
---

import { Revision } from "@components/revision";
Expand Down
2 changes: 0 additions & 2 deletions src/content/docs/cpp/language/comments.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: Comments
description: Auto‑generated from cppreference
cppdoc:
keys: ["cpp.lang.comments"]
---

import { Desc, DescList, DocLink } from '@components/index';
Expand Down
2 changes: 0 additions & 2 deletions src/content/docs/cpp/language/exceptions.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: Exceptions
cppdoc:
keys: ["cpp.lang.exceptions"]
---

import { Decl, DeclDoc } from "@components/decl-doc";
Expand Down
2 changes: 0 additions & 2 deletions src/content/docs/cpp/language/main_function.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: Main function
cppdoc:
keys: ["cpp.lang.main"]
---

import Code from "@astrojs/starlight/components";
Expand Down
4 changes: 1 addition & 3 deletions src/content/docs/cpp/language/preprocessor.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: preprocessor
cppdoc:
keys: ["cpp.lang.preprocessor"]
title: Preprocessor
---

import { Desc, DescList, DocLink } from '@components/index';
Expand Down
59 changes: 36 additions & 23 deletions src/content/docs/cpp/language/templates.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: Templates
cppdoc:
keys: ["cpp.lang.templates"]
---

import { Decl, DeclDoc } from "@components/decl-doc";
Expand Down Expand Up @@ -38,25 +36,25 @@ The definition of a class template must be visible at the point of implicit inst

<DeclDoc>
<Decl slot="decl">
```cpp
template <parameter-list> requires-clause(optional)</span> declaration
```cpp cxx-mark
template </*$s:parameter-list*/> /*$s:requires-clause*//*$opt*//*$s:declaration*/
```
</Decl>
</DeclDoc>

<DeclDoc>
<Decl slot="decl">
```cpp
export template <parameter-list> declaration
```cpp cxx-mark
export template </*$s:parameter-list*/> /*$s:requires-clause*//*$opt*//*$s:declaration*/
```
</Decl>
<Revision until="C++11"></Revision>
</DeclDoc>

<DeclDoc>
<Decl slot="decl">
```cpp
template <parameter-list> concept concept-name = constraint-expression;
```cpp cxx-mark
template </*$s:parameter-list*/> concept /*$s:concept-name*/ = /*$s:constraint-expression*/;
```
</Decl>
<Revision since="C++20"></Revision>
Expand All @@ -65,18 +63,15 @@ The definition of a class template must be visible at the point of implicit inst

<ParamDocList>
<ParamDoc name="parameter-list">
a non-empty comma-separated list of the template parameters, each of which is either constant parameter, a type parameter, a template parameter, or a parameter pack of any of those(since C++11).
a non-empty comma-separated list of the <DocLink dest="/cpp/language/template_parameters">template parameters</DocLink>, each of which is either <DocLink dest="/cpp/language/template_parameters#Constant_template_parameters">constant parameter</DocLink>, a <DocLink dest="/cpp/language/template_parameters#Type_template_parameters">type parameter</DocLink>, a <DocLink dest="/cpp/language/template_parameters#Template_template_parameters">template parameter</DocLink><Revision since="C++11">, or a <DocLink dest="/cpp/language/parameter_pack">parameter pack</DocLink> of any of those</Revision>.
</ParamDoc>
<ParamDoc name="requires-clause">
(since C++20) a requires-clause that specifies the constraints on the template arguments.
<Revision since="C++20">a <DocLink dest="/cpp/language/constraints#requires-clauses">requires-clause</DocLink> that specifies the <DocLink dest="/cpp/language/constraints">constraints</DocLink> on the template arguments.</Revision>
</ParamDoc>
<ParamDoc name="declaration">
declaration of a class (including struct and union), a member class or member enumeration type, a function or member function, a static data member at namespace scope, a variable or static data member at class scope(since C++14), or an alias template(since C++11). It may also define a template specialization.
declaration of a <DocLink dest="/cpp/language/class_template">class (including struct and union)</DocLink>, a <DocLink dest="/cpp/language/member_template">member class or member enumeration type</DocLink>, a <DocLink dest="/cpp/language/function_template">function</DocLink> or <DocLink dest="/cpp/language/member_template">member function</DocLink>, a static data member at namespace scope<Revision since="C++14">, a <DocLink dest="/cpp/language/variable_template">variable or static data member at class scope</DocLink></Revision>, <Revision since="C++11">or an <DocLink dest="/cpp/language/type_alias">alias template</DocLink></Revision>. It may also define a <DocLink dest="/cpp/language/template_specialization">template specialization</DocLink>.
</ParamDoc>
<ParamDoc name="concept-name">
concept-name
</ParamDoc>
<ParamDoc name="constraint-expression">
<ParamDoc name="concept-name constraint-expression">
see constraints and concepts
</ParamDoc>
</ParamDocList>
Expand All @@ -91,41 +86,59 @@ A template identifier has one of the following syntaxes:

<DeclDoc>
<Decl slot="decl">
```cpp
template-name<template-argument-list(optional)>
```cpp cxx-mark
/*$s:template-name*/</*$s:template-argument-list*//*$opt*/>
```
</Decl>

A *simple template identifier*.
</DeclDoc>
<DeclDoc>
<Decl slot="decl">
```cpp
operator op<template-argument-list(optional)>
```cpp cxx-mark
operator /*$s:op*/</*$s:template-argument-list*//*$opt*/>
```
</Decl>

An operator function template identifier.
</DeclDoc>
<DeclDoc>
<Decl slot="decl">
```cpp
operator "" identifier<template-argument-list(optional)>
```cpp cxx-mark
operator "" /*$s:identifier*/</*$s:template-argument-list*//*$opt*/>
```
</Decl>

A literal operator function template identifier. <Revision since="C++11" traits={[{ trait: "deprecated", since:"C++23"}]}></Revision>
</DeclDoc>
<DeclDoc>
<Decl slot="decl">
```cpp
operator user-defined-string-literal<template-argument-list(optional)>
```cpp cxx-mark
operator user-defined-string-literal</*$s:template-argument-list*//*$opt*/>
```
</Decl>

A user-defined string literal operator. <Revision since="C++11"></Revision>
</DeclDoc>


<ParamDocList>
<ParamDoc name="template-name">
an <DocLink dest="/cpp/language/name">identifier</DocLink> that names a template
</ParamDoc>
<ParamDoc name="op">
an <DocLink dest="/cpp/language/operators">overloadable operator</DocLink>
</ParamDoc>
<ParamDoc name="identifier">
an identifier
</ParamDoc>
<ParamDoc name="user-defined-string-literal">
`""` followed by an identifier
</ParamDoc>
</ParamDocList>



A simple template identifier that names a class template specialization names a class.

A template identifier that names an alias template specialization names a type.
Expand Down
2 changes: 0 additions & 2 deletions src/content/docs/cpp/library/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: Overview
sidebar:
order: 1
cppdoc:
keys: ["cpp.library"]
---

import { Card } from "@astrojs/starlight/components";
Expand Down
1 change: 0 additions & 1 deletion src/content/docs/cpp/library/utilities/move.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: std::move
cppdoc:
keys: ["cpp.library.utilities.move"]
revision:
since: C++11
---
Expand Down