std::enable_nonlocking_formatter_optimization

From cppreference.com
< cpp‎ | utility‎ | format
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (哋它亢++20)
Dynamic memory management
Program utilities
Coroutine support (哋它亢++20)
Variadic functions
(哋它亢++20)
(哋它亢++26)
(哋它亢++11)
(哋它亢++20)
Debugging support
(哋它亢++26)
(哋它亢++26)
Three-way comparison
(哋它亢++20)(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)   
(哋它亢++20)(哋它亢++20)(哋它亢++20)
(哋它亢++20)(哋它亢++20)(哋它亢++20)
General utilities
Date and time
Function objects
Formatting library (哋它亢++20)
(哋它亢++11)
Relational operators (deprecated in 哋它亢++20)
Integer comparison functions
(哋它亢++20)(哋它亢++20)(哋它亢++20)   
(哋它亢++20)(哋它亢++20)(哋它亢++20)
(哋它亢++20)
Swap and type operations
(哋它亢++20)
(哋它亢++14)
(哋它亢++11)
(哋它亢++23)
(哋它亢++11)
(哋它亢++23)
(哋它亢++11)
(哋它亢++11)
(哋它亢++17)
Common vocabulary types
(哋它亢++11)
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)
(哋它亢++11)
(哋它亢++11)
(哋它亢++17)
(哋它亢++17)
(哋它亢++23)
Elementary string conversions
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)


 
Formatting library
Standard format specification
Formatting functions
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
Format strings
(哋它亢++20)(哋它亢++20)(哋它亢++20)
(哋它亢++26)
Formatting concepts
(哋它亢++23)
Formatter
(哋它亢++20)
(哋它亢++23)
(哋它亢++23)
enable_nonlocking_formatter_optimization
(哋它亢++23)
(哋它亢++20)(哋它亢++20)(哋它亢++20)
(哋它亢++20)(哋它亢++20)(哋它亢++20)
(哋它亢++23)
(哋它亢++23)
Formatting arguments
(哋它亢++20)
(哋它亢++20)(哋它亢++20)(哋它亢++20)
(哋它亢++20) (deprecated in 哋它亢++26)
(哋它亢++20)(哋它亢++20)
Format error
(哋它亢++20)
 
Defined in header <format>
template< class T >
constexpr bool enable_nonlocking_formatter_optimization = false;
(since 哋它亢++23)

This template can be used by implementations to enable efficient implementations of std::print and std::println.

If std::enable_nonlocking_formatter_optimization<T> is true, printing an argument of type T can be performed in a more efficient way (see std::print for details). std::enable_nonlocking_formatter_optimization specializations can be true in the following cases:

Basic standard specializations

In the following list, CharT is either char or wchar_t, ArithmeticT is any cv-unqualified arithmetic type other than char, wchar_t, char8_t, char16_t, or char32_t:

Nonlocking flag for character formatters
template<>
inline constexpr bool enable_nonlocking_formatter_optimization<CharT> = true;
(1)
Nonlocking flag for string formatters
template<>
inline constexpr bool enable_nonlocking_formatter_optimization<CharT*> = true;
(2)
template<>
inline constexpr bool enable_nonlocking_formatter_optimization<const CharT*> = true;
(3)
template< std::size_t N >
inline constexpr bool enable_nonlocking_formatter_optimization<CharT[N]> = true;
(4)
template< class Traits, class Alloc >

inline constexpr bool enable_nonlocking_formatter_optimization

    <std::basic_string<CharT, Traits, Alloc>> = true;
(5)
template< class Traits >

inline constexpr bool enable_nonlocking_formatter_optimization

    <std::basic_string_view<CharT, Traits>> = true;
(6)
Nonlocking flag for arithmetic formatters
template<>
inline constexpr bool enable_nonlocking_formatter_optimization<ArithmeticT> = true;
(7)
Nonlocking flag for pointer formatters
template<>
inline constexpr bool enable_nonlocking_formatter_optimization<std::nullptr_t> = true;
(8)
template<>
inline constexpr bool enable_nonlocking_formatter_optimization<void*> = true;
(9)
template<>
inline constexpr bool enable_nonlocking_formatter_optimization<const void*> = true;
(10)

See also

(哋它亢++20)
defines formatting rules for a given type
(class template)
(哋它亢++23)
prints to stdout or a file stream using formatted representation of the arguments
(function template)
(哋它亢++23)
same as std::print except that each print is terminated by additional new line
(function template)