C++ åèæå
- C++11
- C++14
- C++17
- C++20
- C++ ç¼è¯å¨æ¯ææ åµè¡¨
- ç¬ç«ä¸å®¿ä¸»å®ç°
- C++ è¯è¨
- C++ å ³é®è¯
- é¢å¤çå¨
- C++ æ ååºå¤´æä»¶
- æ ååºå¤´æä»¶ <ctime>
- æ ååºå¤´æä»¶ <cstring>
- æ ååºå¤´æä»¶ <set>
- æ ååºå¤´æä»¶ <cctype>
- æ ååºå¤´æä»¶ <cwctype>
- æ ååºå¤´æä»¶ <utility>
- æ ååºå¤´æä»¶ <queue>
- æ ååºå¤´æä»¶ <complex>
- æ ååºå¤´æä»¶ <iterator>
- æ ååºå¤´æä»¶ <algorithm>
- æ ååºå¤´æä»¶ <valarray>
- æ ååºå¤´æä»¶ <numeric>
- æ ååºå¤´æä»¶ <cmath>
- æ ååºå¤´æä»¶ <iosfwd>
- æ ååºå¤´æä»¶ <ios>
- æ ååºå¤´æä»¶ <iomanip>
- æ ååºå¤´æä»¶ <streambuf>
- æ ååºå¤´æä»¶ <istream>
- æ ååºå¤´æä»¶ <ostream>
- æ ååºå¤´æä»¶ <iostream>
- æ ååºå¤´æä»¶ <sstream>
- æ ååºå¤´æä»¶ <clocale>
- æ ååºå¤´æä»¶ <vector>
- æ ååºå¤´æä»¶ <deque>
- æ ååºå¤´æä»¶ <list>
- æ ååºå¤´æä»¶ <map>
- æ ååºå¤´æä»¶ <cwchar>
- æ ååºå¤´æä»¶ <locale>
- æ ååºå¤´æä»¶ <codecvt>
- æ ååºå¤´æä»¶ <bitset>
- æ ååºå¤´æä»¶ <functional>
- æ ååºå¤´æä»¶ <stdexcept>
- æ ååºå¤´æä»¶ <csignal>
- æ ååºå¤´æä»¶ <csetjmp>
- æ ååºå¤´æä»¶ <stack>
- æ ååºå¤´æä»¶ <cassert>
- æ ååºå¤´æä»¶ <cerrno>
- æ ååºå¤´æä»¶ <memory>
- æ ååºå¤´æä»¶ <typeindex>
- æ ååºå¤´æä»¶ <type_traits>
- æ ååºå¤´æä»¶ <chrono>
- æ ååºå¤´æä»¶ <initializer_list>
- æ ååºå¤´æä»¶ <tuple>
- æ ååºå¤´æä»¶ <scoped_allocator>
- æ ååºå¤´æä»¶ <cstdint>
- æ ååºå¤´æä»¶ <cinttypes>
- æ ååºå¤´æä»¶ <system_error>
- æ ååºå¤´æä»¶ <cuchar>
- æ ååºå¤´æä»¶ <array>
- æ ååºå¤´æä»¶ <forward_list>
- æ ååºå¤´æä»¶ <unordered_set>
- æ ååºå¤´æä»¶ <unordered_map>
- æ ååºå¤´æä»¶ <random>
- æ ååºå¤´æä»¶ <ratio>
- æ ååºå¤´æä»¶ <cfenv>
- æ ååºå¤´æä»¶ <regex>
- æ ååºå¤´æä»¶ <atomic>
- æ ååºå¤´æä»¶ <thread>
- æ ååºå¤´æä»¶ <mutex>
- æ ååºå¤´æä»¶ <future>
- æ ååºå¤´æä»¶ <condition_variable>
- æ ååºå¤´æä»¶ <any>
- æ ååºå¤´æä»¶ <optional>
- æ ååºå¤´æä»¶ <variant>
- æ ååºå¤´æä»¶ <memory_resource>
- æ ååºå¤´æä»¶ <string_view>
- æ ååºå¤´æä»¶ <charconv>
- æ ååºå¤´æä»¶ <execution>
- æ ååºå¤´æä»¶ <filesystem>
- æ ååºå¤´æä»¶ <concepts>
- æ ååºå¤´æä»¶ <coroutine>
- æ ååºå¤´æä»¶ <compare>
- æ ååºå¤´æä»¶ <version>
- æ ååºå¤´æä»¶ <source_location>
- æ ååºå¤´æä»¶ <format>
- æ ååºå¤´æä»¶ <span>
- æ ååºå¤´æä»¶ <ranges>
- æ ååºå¤´æä»¶ <bit>
- æ ååºå¤´æä»¶ <numbers>
- æ ååºå¤´æä»¶ <syncstream>
- æ ååºå¤´æä»¶ <stop_token>
- æ ååºå¤´æä»¶ <semaphore>
- æ ååºå¤´æä»¶ <latch>
- æ ååºå¤´æä»¶ <barrier>
- æ ååºå¤´æä»¶ <string>
- æ ååºå¤´æä»¶ <cstddef>
- æ ååºå¤´æä»¶ <limits>
- æ ååºå¤´æä»¶ <cfloat>
- æ ååºå¤´æä»¶ <climits>
- æ ååºå¤´æä»¶ <cstdlib>
- æ ååºå¤´æä»¶ <new>
- æ ååºå¤´æä»¶ <typeinfo>
- æ ååºå¤´æä»¶ <exception>
- æ ååºå¤´æä»¶ <cstdarg>
- æ ååºå¤´æä»¶ <ciso646>
- æ ååºå¤´æä»¶ <cstdalign>
- æ ååºå¤´æä»¶ <cstdbool>
- æ ååºå¤´æä»¶ <fstream>
- æ ååºå¤´æä»¶ <cstdio>
- æ ååºå¤´æä»¶ <strstream>
- æ ååºå¤´æä»¶ <shared_mutex>
- æ ååºå¤´æä»¶ <ccomplex>
- æ ååºå¤´æä»¶ <ctgmath>
- 注é
- å ·åè¦æ±
- åè½ç¹æ§æµè¯ (C++20)
- å·¥å ·åº
- ç±»åæ¯æï¼åºæ¬ç±»åãRTTIãç±»åç¹æ§ï¼
- æ¦å¿µåº (C++20)
- é误å¤ç
- 卿å å管ç
- æ¥æåæ¶é´å·¥å ·
- å符串åº
- 容å¨åº
- è¿ä»£å¨åº
- èå´åº (C++20)
- ç®æ³åº
- æ°å¼åº
- è¾å ¥/è¾åºåº
- æä»¶ç³»ç»åº
- æ¬å°ååº
- æ£å表达å¼åº
- ååæä½åº
- çº¿ç¨æ¯æåº
- å®éªæ§ C++ ç¹æ§
- æç¨çèµæº
- ç´¢å¼
- std 符å·ç´¢å¼
- åç¨æ¯æ (C++20)
- C++ å ³é®è¯
ä½ç½®ï¼é¦é¡µ > C++ åèæå >C++ æ ååºå¤´æä»¶ > æ ååºå¤´æä»¶ <format>
æ ååºå¤´æä»¶ <format>
æ¤å¤´æä»¶æ¯æ ¼å¼ååºçä¸é¨åã
ç±» | |
| (C++20) |
å®ä¹ç»å®ç±»åçæ ¼å¼åè§åçç±»æ¨¡æ¿ (类模æ¿) |
| (C++20)(C++20)(C++20) |
æ ¼å¼åå符串åæå¨ç¶æ (类模æ¿) |
| (C++20)(C++20)(C++20) |
æ ¼å¼åç¶æï¼å
æ¬æææ ¼å¼ååæ°åè¾åºè¿ä»£å¨ (类模æ¿) |
| (C++20) |
æä¾å¯¹ç¨æ·å®ä¹æ ¼å¼åå¨çæ ¼å¼ååæ°ç访é®çç±» (类模æ¿) |
| (C++20)(C++20)(C++20)(C++20) |
æä¾å¯¹æææ ¼å¼ååæ°ç访é®çç±» (类模æ¿) |
| (C++20) |
æ ¼å¼åéè¯¯æ¶æåºçå¼å¸¸ç±»å (ç±») |
彿° | |
| (C++20) |
卿° string ä¸åå¨åæ°çæ ¼å¼å表示 (彿°æ¨¡æ¿) |
| (C++20) |
éè¿è¾åºè¿ä»£å¨åå
¶åæ°çæ ¼å¼å表示 (彿°æ¨¡æ¿) |
| (C++20) |
éè¿è¾åºè¿ä»£å¨åå
¶åæ°çæ ¼å¼å表示ï¼ä¸è¶
åºæå®çå¤§å° (彿°æ¨¡æ¿) |
| (C++20) |
ç¡®å®åå¨å
¶åæ°çæ ¼å¼å表示æéçåç¬¦æ° (彿°æ¨¡æ¿) |
| (C++20) |
std::format ç使ç¨ç±»åæ¦é¤çåæ°è¡¨ç¤ºç鿍¡æ¿åä½ (彿°) |
| (C++20) |
std::format_to ç使ç¨ç±»åæ¦é¤çåæ°è¡¨ç¤ºç鿍¡æ¿åä½ (彿°æ¨¡æ¿) |
| (C++20) |
ç¨æ·å®ä¹æ ¼å¼åå¨çåæ°è§è§æ¥å£ (彿°æ¨¡æ¿) |
| (C++20)(C++20) |
å建å¼ç¨æææ ¼å¼ååæ°çç±»åæ¦é¤å¯¹è±¡ï¼å¯è½¬æ¢å° format_args (彿°æ¨¡æ¿) |
æ¦è¦
namespace std { // æ ¼å¼å彿° template<class... Args> string format(string_view fmt, const Args&... args); template<class... Args> wstring format(wstring_view fmt, const Args&... args); template<class... Args> string format(const locale& loc, string_view fmt, const Args&... args); template<class... Args> wstring format(const locale& loc, wstring_view fmt, const Args&... args);  string vformat(string_view fmt, format_args args); wstring vformat(wstring_view fmt, wformat_args args); string vformat(const locale& loc, string_view fmt, format_args args); wstring vformat(const locale& loc, wstring_view fmt, wformat_args args);  template<class Out, class... Args> Out format_to(Out out, string_view fmt, const Args&... args); template<class Out, class... Args> Out format_to(Out out, wstring_view fmt, const Args&... args); template<class Out, class... Args> Out format_to(Out out, const locale& loc, string_view fmt, const Args&... args); template<class Out, class... Args> Out format_to(Out out, const locale& loc, wstring_view fmt, const Args&... args);  template<class Out> Out vformat_to(Out out, string_view fmt, format_args_t<type_identity_t<Out>, char> args); template<class Out> Out vformat_to(Out out, wstring_view fmt, format_args_t<type_identity_t<Out>, wchar_t> args); template<class Out> Out vformat_to(Out out, const locale& loc, string_view fmt, format_args_t<type_identity_t<Out>, char> args); template<class Out> Out vformat_to(Out out, const locale& loc, wstring_view fmt, format_args_t<type_identity_t<Out>, wchar_t> args);  template<class Out> struct format_to_n_result { Out out; iter_difference_t<Out> size; }; template<class Out, class... Args> format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, string_view fmt, const Args&... args); template<class Out, class... Args> format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, wstring_view fmt, const Args&... args); template<class Out, class... Args> format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, const locale& loc, string_view fmt, const Args&... args); template<class Out, class... Args> format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n, const locale& loc, wstring_view fmt, const Args&... args);  template<class... Args> size_t formatted_size(string_view fmt, const Args&... args); template<class... Args> size_t formatted_size(wstring_view fmt, const Args&... args); template<class... Args> size_t formatted_size(const locale& loc, string_view fmt, const Args&... args); template<class... Args> size_t formatted_size(const locale& loc, wstring_view fmt, const Args&... args);  // æ ¼å¼åå¨ template<class T, class charT = char> struct formatter;  // ç±»æ¨¡æ¿ basic_format_parse_context template<class charT> class basic_format_parse_context; using format_parse_context = basic_format_parse_context<char>; using wformat_parse_context = basic_format_parse_context<wchar_t>;  template<class Out, class charT> class basic_format_context; using format_context = basic_format_context<unspecified, char>; using wformat_context = basic_format_context<unspecified, wchar_t>;  // å®å // ç±»æ¨¡æ¿ basic_format_arg template<class Context> class basic_format_arg;  template<class Visitor, class Context> /* è§æè¿° */ visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg);  // class template format-arg-store template<class Context, class... Args> struct /*format-arg-store*/; // ä» ä¸ºéé  template<class Context = format_context, class... Args> /*format-arg-store*/<Context, Args...> make_format_args(const Args&... args); template<class... Args> /*format-arg-store*/<wformat_context, Args...> make_wformat_args(const Args&... args);  // ç±»æ¨¡æ¿ basic_format_args template<class Context> class basic_format_args; using format_args = basic_format_args<format_context>; using wformat_args = basic_format_args<wformat_context>;  template<class Out, class charT> using format_args_t = basic_format_args<basic_format_context<Out, charT>>;  // ç±» format_error class format_error; }
ç±»æ¨¡æ¿ std::basic_format_parse_context
namespace std { template<class charT> class basic_format_parse_context { public: using char_type = charT; using const_iterator = typename basic_string_view<charT>::const_iterator; using iterator = const_iterator;  private: iterator begin_; // ä» ä¸ºéé iterator end_; // ä» ä¸ºéé enum indexing { unknown, manual, automatic }; // ä» ä¸ºéé indexing indexing_; // ä» ä¸ºéé size_t next_arg_id_; // ä» ä¸ºéé size_t num_args_; // ä» ä¸ºéé  public: constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, size_t num_args = 0) noexcept; basic_format_parse_context(const basic_format_parse_context&) = delete; basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;  constexpr const_iterator begin() const noexcept; constexpr const_iterator end() const noexcept; constexpr void advance_to(const_iterator it);  constexpr size_t next_arg_id(); constexpr void check_arg_id(size_t id); }; }
ç±»æ¨¡æ¿ std::basic_format_context
namespace std { template<class Out, class charT> class basic_format_context { basic_format_args<basic_format_context> args_; // ä» ä¸ºéé Out out_; // ä» ä¸ºéé  public: using iterator = Out; using char_type = charT; template<class T> using formatter_type = formatter<T, charT>;  basic_format_arg<basic_format_context> arg(size_t id) const; std::locale locale();  iterator out(); void advance_to(iterator it); }; }
ç±»æ¨¡æ¿ std::basic_format_arg
namespace std { template<class Context> class basic_format_arg { public: class handle;  private: using char_type = typename Context::char_type; // ä» ä¸ºéé  variant<monostate, bool, char_type, int, unsigned int, long long int, unsigned long long int, float, double, long double, const char_type*, basic_string_view<char_type>, const void*, handle> value; // ä» ä¸ºéé  template<class T> explicit basic_format_arg(const T& v) noexcept; // ä» ä¸ºéé explicit basic_format_arg(float n) noexcept; // ä» ä¸ºéé explicit basic_format_arg(double n) noexcept; // ä» ä¸ºéé explicit basic_format_arg(long double n) noexcept; // ä» ä¸ºéé explicit basic_format_arg(const char_type* s); // ä» ä¸ºéé  template<class traits> explicit basic_format_arg( basic_string_view<char_type, traits> s) noexcept; // ä» ä¸ºéé  template<class traits, class Allocator> explicit basic_format_arg( const basic_string<char_type, traits, Allocator>& s) noexcept; // ä» ä¸ºéé  explicit basic_format_arg(nullptr_t) noexcept; // ä» ä¸ºéé  template<class T> explicit basic_format_arg(const T* p) noexcept; // ä» ä¸ºéé  public: basic_format_arg() noexcept;  explicit operator bool() const noexcept; }; }
ç±» std::basic_format_arg::handle
namespace std { template<class Context> class basic_format_arg<Context>::handle { const void* ptr_; // ä» ä¸ºéé void (*format_)(basic_format_parse_context<char_type>&, Context&, const void*); // ä» ä¸ºéé  template<class T> explicit handle(const T& val) noexcept; // ä» ä¸ºéé  friend class basic_format_arg<Context>; // ä» ä¸ºéé  public: void format(basic_format_parse_context<char_type>&, Context& ctx) const; }; }
ç±»æ¨¡æ¿ format-arg-store
namespace std { template<class Context, class... Args> struct /*format-arg-store*/ { // ä» ä¸ºéé array<basic_format_arg<Context>, sizeof...(Args)> args; }; }
ç±»æ¨¡æ¿ std::basic_format_args
namespace std { template<class Context> class basic_format_args { size_t size_; // ä» ä¸ºéé const basic_format_arg<Context>* data_; // ä» ä¸ºéé  public: basic_format_args() noexcept;  template<class... Args> basic_format_args(const /*format-arg-store*/<Context, Args...>& store) noexcept;  basic_format_arg<Context> get(size_t i) const noexcept; }; }
ç±» std::format_error
namespace std { class format_error : public runtime_error { public: explicit format_error(const string& what_arg); explicit format_error(const char* what_arg); }; }