This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

42
cppdraft/any/observers.md Normal file
View File

@@ -0,0 +1,42 @@
[any.observers]
# 22 General utilities library [[utilities]](./#utilities)
## 22.7 Storage for any type [[any]](any#observers)
### 22.7.4 Class any [[any.class]](any.class#any.observers)
#### 22.7.4.5 Observers [any.observers]
[🔗](#lib:has_value,any)
`bool has_value() const noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L7505)
*Returns*: true if *this contains an object, otherwise false[.](#1.sentence-1)
[🔗](#lib:type,any)
`const type_info& type() const noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L7516)
*Returns*: typeid(T) if *this has a contained value of type T,
otherwise typeid(void)[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L7521)
[*Note [1](#note-1)*:
Useful for querying against types known either at compile time or only at runtime[.](#3.sentence-1)
— *end note*]