Skip to content

Commit 869218d

Browse files
committed
fix: replace src by dest
1 parent 806728f commit 869218d

File tree

4 files changed

+120
-120
lines changed

4 files changed

+120
-120
lines changed

src/content/docs/cpp/language/functions.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Revision, RevisionBlock } from "@components/revision";
88
import DocLink from "@components/DocLink.astro";
99
import NamedReq from "@components/NamedReq.astro";
1010

11-
Functions are C++ entities that associate a sequence of <DocLink src="/cpp/language/statements">statements</DocLink> (a _function body_) with a _name_ and a list of zero or more _function parameters_.
11+
Functions are C++ entities that associate a sequence of <DocLink dest="/cpp/language/statements">statements</DocLink> (a _function body_) with a _name_ and a list of zero or more _function parameters_.
1212

1313
```cpp
1414
// function name: "isodd"
@@ -19,7 +19,7 @@ bool isodd(int n) { // the body of the function begins
1919
} // the body of the function ends
2020
```
2121
22-
When a function is invoked, e.g. in a <DocLink src="/cpp/language/expressions/operator_other" section="built-in-function-call-operator">function-call expression</DocLink>, the parameters are initialized from the arguments (either provided at the place of call or <DocLink src="/cpp/language/functions/default_arguments">defaulted</DocLink>) and the statements in the function body are executed. If the <DocLink src="/cpp/language/functions/function" section="parameter-list">parameter list</DocLink> ends with `...`, extra arguments can be supplied to the function, such a function is called <DocLink src="/cpp/language/functions/variadic_arguments">variadic function</DocLink>.
22+
When a function is invoked, e.g. in a <DocLink dest="/cpp/language/expressions/operator_other" section="built-in-function-call-operator">function-call expression</DocLink>, the parameters are initialized from the arguments (either provided at the place of call or <DocLink dest="/cpp/language/functions/default_arguments">defaulted</DocLink>) and the statements in the function body are executed. If the <DocLink dest="/cpp/language/functions/function" section="parameter-list">parameter list</DocLink> ends with `...`, extra arguments can be supplied to the function, such a function is called <DocLink dest="/cpp/language/functions/variadic_arguments">variadic function</DocLink>.
2323
2424
```cpp
2525
int main() {
@@ -29,28 +29,28 @@ int main() {
2929
}
3030
```
3131

32-
<DocLink src="/cpp/language/basic_concepts/unqualified_lookup">Unqualified</DocLink> function names in function-call expressions are looked up with an extra set of rules called <DocLink src="/cpp/language/functions/adl">"argument-dependent lookup" (ADL)</DocLink>.
32+
<DocLink dest="/cpp/language/basic_concepts/unqualified_lookup">Unqualified</DocLink> function names in function-call expressions are looked up with an extra set of rules called <DocLink dest="/cpp/language/functions/adl">"argument-dependent lookup" (ADL)</DocLink>.
3333

34-
A function can terminate by <DocLink src="/cpp/language/statements/return">returning</DocLink> or by <DocLink src="/cpp/language/exceptions/throw">throwing</DocLink> an <DocLink src="/cpp/language/exceptions">exception</DocLink>.
34+
A function can terminate by <DocLink dest="/cpp/language/statements/return">returning</DocLink> or by <DocLink dest="/cpp/language/exceptions/throw">throwing</DocLink> an <DocLink dest="/cpp/language/exceptions">exception</DocLink>.
3535

3636
<RevisionBlock since="C++20">
37-
A function may be a <DocLink src="/cpp/language/functions/coroutines">coroutine</DocLink>, in which case it can suspend execution to be resumed later.
37+
A function may be a <DocLink dest="/cpp/language/functions/coroutines">coroutine</DocLink>, in which case it can suspend execution to be resumed later.
3838
</RevisionBlock>
3939

40-
A <DocLink src="/cpp/language/functions/function">function declaration</DocLink> may appear in any scope, but a <DocLink src="/cpp/language/functions/function">function definition</DocLink> may only appear in namespace scope or, for <DocLink src="/cpp/language/classes/member_functions">member</DocLink> and <DocLink src="/cpp/language/classes/friend">friend</DocLink> functions, in class scope. A function that is declared in a class body without a friend specifier is a class member function. Such functions have many additional properties, see <DocLink src="/cpp/language/classes/member_functions">member functions</DocLink> for details.
40+
A <DocLink dest="/cpp/language/functions/function">function declaration</DocLink> may appear in any scope, but a <DocLink dest="/cpp/language/functions/function">function definition</DocLink> may only appear in namespace scope or, for <DocLink dest="/cpp/language/classes/member_functions">member</DocLink> and <DocLink dest="/cpp/language/classes/friend">friend</DocLink> functions, in class scope. A function that is declared in a class body without a friend specifier is a class member function. Such functions have many additional properties, see <DocLink dest="/cpp/language/classes/member_functions">member functions</DocLink> for details.
4141

42-
Functions are not objects: there are no arrays of functions and functions cannot be passed by value or returned from other functions. Pointers and references to functions (except for the <DocLink src="/cpp/language/basic_concepts/main_function">main function</DocLink><Revision since="C++20"> and <DocLink src="/cpp/language/extending_std" section="addressing-restriction">most standard library functions</DocLink></Revision>) are allowed, and may be used where these functions themselves cannot. Therefore we say these functions are "addressable".
42+
Functions are not objects: there are no arrays of functions and functions cannot be passed by value or returned from other functions. Pointers and references to functions (except for the <DocLink dest="/cpp/language/basic_concepts/main_function">main function</DocLink><Revision since="C++20"> and <DocLink dest="/cpp/language/extending_std" section="addressing-restriction">most standard library functions</DocLink></Revision>) are allowed, and may be used where these functions themselves cannot. Therefore we say these functions are "addressable".
4343

44-
Each function has a type, which consists of the function's return type, the types of all parameters (after array-to-pointer and function-to-pointer transformations, see <DocLink src="/cpp/language/functions/function" section="parameter-list">parameter list</DocLink>) <Revision since="C++17">, whether the function is <DocLink src="/cpp/language/exceptions/noexcept_spec">noexcept</DocLink> or not</Revision>, and, for non-static member functions, cv-qualification <Revision since="C++11">and ref-qualification</Revision>. Function types also have <DocLink src="/cpp/language/declarations/language_linkage">language linkage</DocLink>. There are no cv-qualified function types (not to be confused with the types of <DocLink src="/cpp/language/declarations/language_linkage">cv-qualified functions</DocLink> such as `int f() const;` or functions returning <DocLink src="/cpp/language/declarations/cv">cv-qualified types</DocLink>, such as `std::string const f();`). Any cv-qualifier is ignored if it is added to an alias for a function type.
44+
Each function has a type, which consists of the function's return type, the types of all parameters (after array-to-pointer and function-to-pointer transformations, see <DocLink dest="/cpp/language/functions/function" section="parameter-list">parameter list</DocLink>) <Revision since="C++17">, whether the function is <DocLink dest="/cpp/language/exceptions/noexcept_spec">noexcept</DocLink> or not</Revision>, and, for non-static member functions, cv-qualification <Revision since="C++11">and ref-qualification</Revision>. Function types also have <DocLink dest="/cpp/language/declarations/language_linkage">language linkage</DocLink>. There are no cv-qualified function types (not to be confused with the types of <DocLink dest="/cpp/language/declarations/language_linkage">cv-qualified functions</DocLink> such as `int f() const;` or functions returning <DocLink dest="/cpp/language/declarations/cv">cv-qualified types</DocLink>, such as `std::string const f();`). Any cv-qualifier is ignored if it is added to an alias for a function type.
4545

46-
Multiple functions in the same scope may have the same name, as long as their parameter lists and, for non-static member functions, cv<Revision since="C++11">/ref</Revision>-qualifications are different. This is known as <DocLink src="/cpp/language/functions/overload_resolution">function overloading</DocLink>. Function declarations that differ only in the return type <Revision since="C++17">and the noexcept specification</Revision> cannot be overloaded. The <DocLink src="/cpp/language/functions/overloaded_address">address of an overloaded function</DocLink> is determined differently.
46+
Multiple functions in the same scope may have the same name, as long as their parameter lists and, for non-static member functions, cv<Revision since="C++11">/ref</Revision>-qualifications are different. This is known as <DocLink dest="/cpp/language/functions/overload_resolution">function overloading</DocLink>. Function declarations that differ only in the return type <Revision since="C++17">and the noexcept specification</Revision> cannot be overloaded. The <DocLink dest="/cpp/language/functions/overloaded_address">address of an overloaded function</DocLink> is determined differently.
4747

4848
<RevisionBlock since="C++11">
49-
C++ implements [anonymous functions](https://en.wikipedia.org/wiki/anonymous_function) using <DocLink src="/cpp/language/functions/lambda">lambda-expressions</DocLink>.
49+
C++ implements [anonymous functions](https://en.wikipedia.org/wiki/anonymous_function) using <DocLink dest="/cpp/language/functions/lambda">lambda-expressions</DocLink>.
5050
</RevisionBlock>
5151

5252
## Function objects
5353

54-
Besides function lvalues, the function call expression supports pointers to functions, and any value of class type that overloads the function-call operator or is convertible to function pointer<Revision since="C++11">( including <DocLink src="/cpp/language/functions/lambda">lambda-expressions</DocLink>)</Revision>. Together, these types are known as <NamedReq name="FunctionObjects" />, and they are used ubiquitously through the C++ standard library, see for example, usages of <NamedReq name="BinaryPredicate" /> and <NamedReq name="Compare" />.
54+
Besides function lvalues, the function call expression supports pointers to functions, and any value of class type that overloads the function-call operator or is convertible to function pointer<Revision since="C++11">( including <DocLink dest="/cpp/language/functions/lambda">lambda-expressions</DocLink>)</Revision>. Together, these types are known as <NamedReq name="FunctionObjects" />, and they are used ubiquitously through the C++ standard library, see for example, usages of <NamedReq name="BinaryPredicate" /> and <NamedReq name="Compare" />.
5555

56-
The standard library also provides a number of predefined <DocLink src="/cpp/library/utility/functional">function object templates</DocLink> as well as the methods to compose new ones (including <DocLink src="/cpp/library/utility/functional/less">`std::less`</DocLink><Revision since="C++11">, <DocLink src="/cpp/library/utility/functional/mem_fn">`std::mem_fn`</DocLink>, <DocLink src="/cpp/library/utility/functional/bind">`std::bind`</DocLink>, <DocLink src="/cpp/library/utility/functional/function">`std::function`</DocLink></Revision><Revision since="C++17">, <DocLink src="/cpp/library/utility/functional/not_fn">`std::not_fn`</DocLink></Revision><Revision since="C++20">, <DocLink src="/cpp/library/utility/functional/bind_front">`std::bind_front`</DocLink></Revision><Revision since="C++23">, `std::bind_back`, `std::move_only_function`</Revision><Revision since="C++26">, `std::copyable_function`, and `std::function_ref`</Revision>).
56+
The standard library also provides a number of predefined <DocLink dest="/cpp/library/utility/functional">function object templates</DocLink> as well as the methods to compose new ones (including <DocLink dest="/cpp/library/utility/functional/less">`std::less`</DocLink><Revision since="C++11">, <DocLink dest="/cpp/library/utility/functional/mem_fn">`std::mem_fn`</DocLink>, <DocLink dest="/cpp/library/utility/functional/bind">`std::bind`</DocLink>, <DocLink dest="/cpp/library/utility/functional/function">`std::function`</DocLink></Revision><Revision since="C++17">, <DocLink dest="/cpp/library/utility/functional/not_fn">`std::not_fn`</DocLink></Revision><Revision since="C++20">, <DocLink dest="/cpp/library/utility/functional/bind_front">`std::bind_front`</DocLink></Revision><Revision since="C++23">, `std::bind_back`, `std::move_only_function`</Revision><Revision since="C++26">, `std::copyable_function`, and `std::function_ref`</Revision>).

0 commit comments

Comments
 (0)