Files
2025-10-25 03:02:53 +03:00

35 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[format.fmt.string]
# 28 Text processing library [[text]](./#text)
## 28.5 Formatting [[format]](format#fmt.string)
### 28.5.4 Class template basic_format_string [format.fmt.string]
namespace std {template<class charT, class... Args>struct [basic_format_string](#lib:basic_format_string "28.5.4Class template basic_­format_­string[format.fmt.string]") {private: basic_string_view<charT> *str*; // *exposition only*public:template<class T> consteval basic_format_string(const T& s);
basic_format_string(*runtime-format-string*<charT> s) noexcept : str(s.*str*) {}constexpr basic_string_view<charT> get() const noexcept { return *str*; }};}
[🔗](#itemdecl:1)
`template<class T> consteval basic_format_string(const T& s);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L6680)
*Constraints*: const T& models [convertible_to](concept.convertible#concept:convertible_to "18.4.4Concept convertible_­to[concept.convertible]")<basic_string_view<charT>>[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L6684)
*Effects*: Direct-non-list-initializes *str* with s[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L6688)
*Remarks*: A call to this function is not a core constant expression ([[expr.const]](expr.const "7.7Constant expressions"))
unless there exist args of types Args such that *str* is a format string for args[.](#3.sentence-1)