Espacios de nombres
Variantes

Prueba de características (desde C++20)

De cppreference.com
< cpp

El estándar define un conjunto de macros de preprocesador correspondiente a las características del lenguaje y las biblioteca de C++, introducidas en C++11 o posterior. Pretenden ser una forma simple y portátil de detectar la presencia de dichas características.

Atributos

__has_cpp_attribute( token-de-atributo )

Verifica la presencia de un atributo denominado por token-de-atributo (después de la expansión de macro).

Para cada atributos estándar, la implementación define si __has_cpp_attribute se expandirá al valor que aparece en la tabla siguiente (que corresponde a año y mes en que el atributo se agregó al borrador de trabajo) o a 0. Se expandirá al valor mostrado en la tabla solamente si el atributo estándar provoca que la implementación se comporte según la recomendación (creando mensajes de diagnóstico, afectando a la estructura de las clases, etc.).

La presencia de atributos específicos del proveedor se determina por un valor distinto de cero.

__has_cpp_attribute se puede expandir en la expresión de #if y #elif. Se trata como una macro definida por #ifdef, #ifndef, #elifdef, #elifndef (desde C++23) y defined, pero no se puede usar en ninguna otra parte.

token-de-atributo Atributo Valor Estándar Documento(s)
assume [[assume]] 202207L (C++23) P1774R8
carries_dependency [[carries_dependency]] 200809L (C++11)
(hasta C++26)
N2556
N2643
P3475R2
deprecated [[deprecated]] 201309L (C++14) N3760
fallthrough [[fallthrough]] 201603L (C++17) P0188R1
indeterminate [[indeterminate]] 202403L (C++26) P2795R5
likely [[likely]] 201803L (C++20) P0479R5
maybe_unused [[maybe_unused]] 201603L (C++17) P0212R1
no_unique_address [[no_unique_address]] 201803L (C++20) P0840R2
nodiscard [[nodiscard]] 201603L (C++17) P0189R1
[[nodiscard]] con motivo 201907L (C++20) P1301R4
noreturn [[noreturn]] 200809L (C++11) N2761
unlikely [[unlikely]] 201803L (C++20) P0479R5
Número total de atributos: 11

Características del lenguaje

Las siguientes macros se pueden usar para detectar cunado una característica del lungujae está implementada en la versión actual. Están predefinidas en cada unidad de traducción.

Cada macro se expande a un literal entero correspondiente al año y mes cuando la característica correspondiente se incluyó en el borrador de trabajo. Cuando una característica cambia significativamente, la macro se actualizará en consecuencia.

Nombre de la macro Característica Valor Estándar Documento(s)
__cpp_aggregate_bases Clases de agregado con clases base 201603L (C++17) P0017R1
__cpp_aggregate_nsdmi Clases de agregado con inicializadores de miembros por defecto 201304L (C++14) N3653
__cpp_aggregate_paren_init Inicialización de agregados en la forma de inicialización directa 201902L (C++20) P0960R3
__cpp_alias_templates Plantillas de alias 200704L (C++11) N2258
__cpp_aligned_new Asignación de memoria dinámica para datos sobrealineados 201606L (C++17) P0035R4
__cpp_attributes Atributos. 200809L (C++11) N2761
__cpp_auto_cast Convertir una expresión a un pr-valor (auto(x)) 202110L (C++23) P0849R8
__cpp_binary_literals Literales binarios 201304L (C++14) N3472
__cpp_capture_star_this Captura de lambda de *this por valor como [=,*this] 201603L (C++17) P0018R3
__cpp_char8_t char8_t 201811L (C++20) P0482R6
Corrección de compatibilidad y portabilidad para char8_t (permite la inicialización de array de caracteres (sin signo) a partir de literales cadena UTF-8) 202207L (C++23)
(DR20)
P2513R4


__cpp_concepts Conceptos 201907L (C++20) P0734R0
P1084R2
P1452R2
Funciones miembro especiales triviales condicionales 202002L P0848R3
P2493R0
__cpp_conditional_explicit Especificador condicional explicit 201806L (C++20) P0892R2
__cpp_consteval Funciones inmediatas] 201811L (C++20) P1073R3
Hace que consteval se propague hacia arriba 202211L (C++23)
(DR20)
P2564R3
__cpp_constexpr constexpr 200704L (C++11) N2235
constexpr relajado, no-const métodos constexpr 201304L (C++14) N3652
Lambda constexpr 201603L (C++17) P0170R1
Llamadas a funciones virtuales en expresiones constantes; bloques try en funciones constexpr, dynamic_cast y typeid polimórfico en expresiones constantes; inicialización por defecto trivial y declaración asm en funciones constexpr 201907L (C++20) P1064R0
P1002R1
P1327R1
P1331R2
P1668R1
Cambiar el miembro activo de una unión en una evaluación constante 202002L P1330R0
P2493R0
Variables no literal, etiquetas e instrucciones goto en funciones constexpr 202110L (C++23) P2242R3
Relaja algunas restricciones sobre funciones constexpr y plantillas de función 202207L P2448R2
Permitir variables constexpr estáticas en funciones constexpr 202211L P2647R1
Constexpr convertido desde void*: hacia el borrado de tipos constexpr 202306L (C++26) P2738R1
Colocación new constexpr 202406L P2747R2
__cpp_constexpr_dynamic_alloc Operaciones para duración de almacenamiento dinámico en funciones constexpr 201907L (C++20) P0784R7
__cpp_constexpr_exceptions Excepciones constexpr 202411L (C++26) P3068R6
__cpp_constexpr_in_decltype Generación de definiciones de funciones y variables cuando es necesario para evaluación constante 201711L (C++20)
(DR11)
P0859R0
__cpp_constexpr_virtual_inheritance herencia virtual constexpr 202506L (C++26) P3533R2
__cpp_constinit constinit 201907L (C++20) P1143R2
__cpp_contracts Contratos 202502L (C++26) P2900R14
__cpp_decltype decltype 200707L (C++11) N2343
__cpp_decltype_auto Deducción del tipo de retorno para funciones normales 201304L (C++14) N3638
__cpp_deduction_guides Deducción de argumentos de plantilla para plantillas de clase 201703L (C++17) P0091R3
P0512R0
P0620R0
Deducción de argumentos de plantilla de clase para agregados y alias 201907L (C++20) P1814R0
P1816R0
__cpp_delegating_constructors Constructores delegados 200604L (C++11) N1986
__cpp_deleted_function Definiciones de funciones eliminadas con mensajes (= delete("debe tener una razón");) 202403L (C++26) P2573R2
__cpp_designated_initializers Inicializadores designados 201707L (C++20) P0329R4
__cpp_enumerator_attributes Atributos para enumeradores 201411L (C++17) N4266
__cpp_expansion_statements Declaraciones de expansión (template for) 202506L (C++26) P1306R5
__cpp_explicit_this_parameter Parámetro de objeto explícito 202110L (C++23) P0847R7
__cpp_fold_expressions Expresiones de pliegue 201603L (C++17) N4295
P0036R0
Ordenación de restricciones que involucran expresiones de pliegue 202406L (C++26) P2963R3
__cpp_generic_lambdas Expresiones lambda genéricas 201304L (C++14) N3649
Lista de parámetros de plantilla explícitos para lambdas genéricas 201707L (C++20) P0428R2
__cpp_guaranteed_copy_elision Elisión de copia garantizada mediante categorías de valor simplificadas. 201606L (C++17) P0135R1
__cpp_hex_float Literales hexadecimales de punto flotante 201603L (C++17) P0245R1
__cpp_if_consteval if consteval 202106L (C++23) P1938R3
__cpp_if_constexpr if constexpr 201606L (C++17) P0292R2
__cpp_impl_coroutine Corrutinas (compiler support) 201902L (C++20) P0912R5
LWG3393
__cpp_impl_destroying_delete Operador delete de destrucción (apoyo del compilador) 201806L (C++20) P0722R3
__cpp_impl_reflection Reflexión 202506L (C++26) P2996R13
P3096R12
P3293R3
P3394R4
P3795R2
__cpp_impl_three_way_comparison Comparación de tres vías (apoyo del compilador) 201907L (C++20) P0515R3
P0768R1
P1185R2
P1630R1
__cpp_implicit_move Movimiento implícito más simple 202207L (C++23) P2266R3
__cpp_inheriting_constructors Constructores heredados 200802L (C++11) N2540
Nueva especificación para constructores_herederos 201511L (C++17)
(DR11)
P0136R1
__cpp_init_captures Captura inicial de Lambda 201304L (C++14) N3648
Permite la expansión del paquete en la captura inicial de lambda 201803L (C++20) P0780R2
__cpp_initializer_lists Inicialización por lista and std::initializer_list 200806L (C++11) N2672
__cpp_inline_variables Variables en línea 201606L (C++17) P0386R2
__cpp_lambdas Expresiones lambda 200907L (C++11) N2927
__cpp_modules Módulos 201907L (C++20) P1103R3
P1811R0
__cpp_multidimensional_subscript operador de índice multidimensional 202110L (C++23) P2128R6
Static operador[] 202211L P2589R1
__cpp_named_character_escapes escape de caracteres universales denominados 202207L (C++23) P2071R2
__cpp_namespace_attributes Atributos parar espacios de nombre 201411L (C++17) N4266
__cpp_noexcept_function_type Hacer que las especificaciones de excepciones sean parte del sistema de tipos 201510L (C++17) P0012R1
__cpp_nontype_template_args Admitir la evaluación constante para todos los argumentos de plantilla de no tipo 201411L (C++17) N4268
Tipos clase y tipos de punto flotante en los parámetros de plantilla de no tipo 201911L (C++20) P1907R1
__cpp_nontype_template_parameter_auto Declarar los parámetros de plantilla de no tipo con auto 201606L (C++17) P0127R2
__cpp_nsdmi Inicializadores de datos miembro no estáticos 200809L (C++11) N2756
__cpp_pack_indexing Indexación de paquetes 202311L (C++26) P2662R3


__cpp_placeholder_variables Un bonito marcador sin nombre 202306L (C++26) P2169R4
__cpp_pp_embed #embed 202502L (C++26) P1967R14
__cpp_range_based_for Bucle for basado en rango 200907L (C++11) N2930
Bucle for basado en rango con distintos tipos begin/end 201603L (C++17) P0184R0
Extensión de vida útil en for basado en rangos 202211L (C++23) P2644R1
P2718R0
CWG2659
__cpp_raw_strings Literales de cadena sin formato 200710L (C++11) N2442
__cpp_ref_qualifiers Calificadores de referencias 200710L (C++11) N2439
__cpp_return_type_deduction Deducción del tipo de retorno para funciones normales 201304L (C++14) N3638
__cpp_rvalue_references Referencia r-valor] 200610L (C++11) N2118
__cpp_size_t_suffix Sufijos de literales para size_t y su versión con signo 202011L (C++23) P0330R8
__cpp_sized_deallocation Desasignación con tamaño 201309L (C++14) N3778
__cpp_static_assert Aserción estática (static_assert) 200410L (C++11) N1720
Aserción estática (static_assert) con un solo argumento 201411L (C++17) N3928
Mensajes de aserción estática static_assert generador por usuario 202306L (C++26) P2741R3
__cpp_static_call_operator operator() estático 202207L (C++23) P1169R4
__cpp_structured_bindings Vínculos estructurados 201606L (C++17) P0217R3
Atributos para vínculos estructurados 202403L (C++26) P0609R3
Declaración de vínculo estructurado como condición 202406L P0963R3
Los vínculos estructurados pueden introducir un paquete 202411L P1061R10
__cpp_template_parameters Concepto y parámetros de plantilla de plantilla variable 202502L (C++26) P2841R7
__cpp_template_template_args Coincidencia de argumentos de plantilla de plantilla 201611L (C++17) P0522R0
__cpp_threadsafe_static_init Inicialización y destrucción dinámica con concurrencia 200806L (C++11) N2660
__cpp_trivial_union Uniones triviales 202603L (C++26) P3074R7
P3726R2
__cpp_unicode_characters Nuevos tipos de carácter (char16_t y char32_t) 200704L (C++11) N2249
__cpp_unicode_literals Literales de cadena Unicode 200710L (C++11) N2442
__cpp_user_defined_literals Literales definidos por el usuario 200809L (C++11) N2765
__cpp_using_enum using enum 201907L (C++20) P1099R5
__cpp_variable_templates Plantillas de variable 201304L (C++14) N3651
__cpp_variadic_friend Declaraciones friend variádicas 202403L (C++26) P2893R3
__cpp_variadic_templates Plantillas variádicas 200704L (C++11) N2242
__cpp_variadic_using Pack expansions in declaraciones using 201611L (C++17) P0195R2
Total number of macros: 78

Características de la biblioteca

Las siguientes macros se pueden usar para detectar si una característica de la biblioteca estándar está implementada en la implementación actual. A diferencia de las macros de comprobación de característica del lenguaje, no están predefinidas. Las proporciona el encabezado <version>.

Para cada macro de prueba de características de biblioteca, también las proporcionan los archivos de cabecera que proporcionan los componentes de la biblioteca estándar correspondientes. Vea macros de prueba de características de biblioteca para un listado completo de archivos de cabecera que proporcionan estas macros.

Cada macro se expande a un literal entero correspondiente al año y mes cuando la característica correspondiente se incluyó en el borrador de trabajo. Cuando una característica cambia significativamente, la macro se actualizará en consecuencia.

Nombre de la macro Característica Valor Estándar Documento(s)
__cpp_lib_adaptor_iterator_pair_constructor Constructores de pares de iteradores para std::stack y std::queue 202106L (C++23) P1425R4
__cpp_lib_addressof_constexpr std::addressof constexpr 201603L (C++17) LWG2296
__cpp_lib_algorithm_default_value_type Habilita la inicialización de lista para algorithm 202403L 202603L (C++26) P2248R8
P3217R0
P3787R2
__cpp_lib_algorithm_iterator_requirements Iteradores de rango como entradas para algoritmos que no usan rangos. 202207L (C++23) P2408R5
__cpp_lib_aligned_accessor std::aligned_accessor: un accesor std::mdspan que expresa sobrealineación de punteros 202411L (C++26) P2897R7


__cpp_lib_allocate_at_least Retroalimentación de tamaño en la interfaz del asignador, por ejemplo: std::allocator::allocate_at_least, std::allocator_traits::allocate_at_least 202302L (C++23) P0401R6
P2652R2
LWG3887
__cpp_lib_allocator_traits_is_always_equal std::allocator_traits::is_always_equal, limpieza noexcept 201411L (C++17) N4258
__cpp_lib_any std::any 201606L (C++17) P0220R1
P0032R3
__cpp_lib_apply std::apply 201603L (C++17) P0220R1
std::apply modifica: std::apply_result, std::is_applicable y std::is_nothrow_applicable 202506L (C++26) P1317R2
__cpp_lib_array_constexpr Constexpr para std::reverse_iterator, std::move_iterator, std::array y acceso a rango 201603L (C++17) P0031R0
ConstexprIterator; comparación constexpr para std::array; bits constexpr varios (std::array::fill, etc.) 201811L (C++20) P0858R0
LWG3257
P1023R0
P1032R1
__cpp_lib_as_const std::as_const 201510L (C++17) P0007R1
__cpp_lib_associative_heterogeneous_erasure Borrado heterogéneo en los contenedores asociativos y los contenedores asociativos no ordenados 202110L (C++23) P2077R3
__cpp_lib_associative_heterogeneous_insertion Sobrecargas heterogéneas para las funciones miembro restantes en contenedores asociativos ordenados y contenedores asociativos no ordenados. 202306L (C++26) P2363R5
__cpp_lib_assume_aligned std::assume_aligned 201811L (C++20) P1007R3
__cpp_lib_atomic_flag_test std::atomic_flag::test 201907L (C++20) P1135R6
__cpp_lib_atomic_float Atómico de punto flotante 201711L (C++20) P0020R6
__cpp_lib_atomic_is_always_lock_free Constexpr std::atomic<T>::is_always_lock_free 201603L (C++17) P0152R1
__cpp_lib_atomic_lock_free_type_aliases Tipos enteros sin bloqueo atómico (std::atomic_signed_lock_free, std::atomic_unsigned_lock_free) 201907L (C++20) P1135R6
__cpp_lib_atomic_min_max Mínimo/máximo atómico (std::atomic::fetch_min, std::atomic::fetch_max, etc) 202403L (C++26) P0493R5
Mínimo/máximo de punto flotante atómico 202506L P3008R6
__cpp_lib_atomic_reductions Operaciones de reducción atómicas 202506L (C++26) P3111R8
__cpp_lib_atomic_ref std::atomic_ref 201806L (C++20) P0019R8
std::atomic_ref::address() 202603L (C++26) P2835R7
P3936R1
__cpp_lib_atomic_shared_ptr std::atomic<std::shared_ptr> 201711L (C++20) P0718R2
__cpp_lib_atomic_value_initialization Corrección de inicialización atómica (inicializar por defecto a std::atomic por valor) 201911L (C++20) P0883R2
__cpp_lib_atomic_wait Espera eficiente de std::atomic 201907L (C++20) P1135R6
__cpp_lib_barrier std::barrier 201907L (C++20) P1135R6
Garantías de finalización de fase de std::barrier 202302L (C++23) P2588R3
__cpp_lib_bind_back std::bind_back 202202L (C++23) P2387R3
Permite pasar objetos invocables como argumentos de plantilla de no tipo a std::bind_back 202306L (C++26) P2714R1
__cpp_lib_bind_front std::bind_front 201907L (C++20) P0356R5
P1651R0
Permite pasar objetos invocables como argumentos de plantilla de no tipo a std::bind_front 202306L (C++26) P2714R1
__cpp_lib_bit_cast std::bit_cast 201806L (C++20) P0476R2
__cpp_lib_bitops Operaciones de bits 201907L (C++20) P0553R4
__cpp_lib_bitset Interfaz entre std::bitset y std::string_view 202306L (C++26) P2697R1
__cpp_lib_bool_constant std::bool_constant 201505L (C++17) N4389
__cpp_lib_bounded_array_traits std::is_bounded_array, std::is_unbounded_array 201902L (C++20) P1357R1
__cpp_lib_boyer_moore_searcher Buscadores 201603L (C++17) P0220R1
__cpp_lib_byte std::byte 201603L (C++17) P0298R3
__cpp_lib_byteswap std::byteswap 202110L (C++23) P1272R4
__cpp_lib_char8_t Apoyo de la biblioteca para char8_t 201907L (C++20) P0482R6
P1423R3
__cpp_lib_chrono Funciones de redondeo para std::chrono::duration y std::chrono::time_point 201510L (C++17) P0092R1
Constexpr para todas las funciones miembro de std::chrono::duration y std::chrono::time_point 201611L P0505R0
Calendarios y Husos horarios 201907L (C++20) P0355R7
P1466R3
Soporte de funciones de hash para las clases de valor std::chrono 202306L (C++26) P2592R3
__cpp_lib_chrono_udls Literales definidos por el usuario para tipos de tiempo 201304L (C++14) N3642
__cpp_lib_clamp std::clamp 201603L (C++17) P0025R1
__cpp_lib_common_reference Convierte std::common_reference_t de std::reference_wrapper en un tipo referencia 202302L (C++23) P2655R3
__cpp_lib_common_reference_wrapper Convierte std::common_reference_t de std::reference_wrapper en un tipo referencia 202302L (C++23) P2655R3
__cpp_lib_counting_scope Ámbitos asíncronos: creación de ámbitos para la concurrencia no secuencial 202506L (C++26) P3149R11
P3815R1
__cpp_lib_complex_udls Literales definidos por el usuario para std::complex 201309L (C++14) N3779
__cpp_lib_concepts Conceptos de la biblioteca estándar 202002L (C++20) P0898R3
P1754R1
P1964R2
Tipos de solo movimiento para equality_comparable_with, totally_ordered_with, y three_way_comparable_with 202207L (C++23) P2404R3
__cpp_lib_constant_wrapper std::constant_wrapper 202603L (C++26) P2781R9
P3978R3
__cpp_lib_constexpr_algorithms Constexpr para algoritmos 201806L (C++20) P0202R3
P0879R0
LWG3256
LWG3792
ordenación estable constexpr 202306L (C++26) P2562R1
__cpp_lib_constexpr_atomic std::atomic y std::atomic_ref constexpr 202411L (C++26) P3309R3
__cpp_lib_constexpr_bitset Un std::bitset más constexpr 202207L (C++23) P2417R2
__cpp_lib_constexpr_charconv Constexpr para std::to_chars y std::from_chars para tipos enteros 202207L (C++23) P2291R3
__cpp_lib_constexpr_cmath Constexpr para funciones matemáticas en <cmath> y <cstdlib> 202202L (C++23) P0533R9
Más constexpr para <cmath> 202306L (C++26) P1383R2
__cpp_lib_constexpr_complex Constexpr para std::complex 201711L (C++20) P0415R1
Más constexpr para <complex> 202306L (C++26) P1383R2
__cpp_lib_constexpr_deque Constexpr std::deque 202502L (C++26) P3372R3
__cpp_lib_constexpr_dynamic_alloc Constexpr para std::allocator y utilerías relacionadas 201907L (C++20) P0784R7
__cpp_lib_constexpr_exceptions Constexpr para tipos excepción, por ejemplo std::bad_alloc, std::bad_cast, etc. 202411L (C++26) P3068R6
Constexpr para más tipos excepción 202502L P3378R2
__cpp_lib_constexpr_flat_map Constexpr std::flat_map y std::flat_multimap 202502L (C++26) P3372R3
__cpp_lib_constexpr_flat_set Constexpr std::flat_set y std::flat_multiset 202502L (C++26) P3372R3
__cpp_lib_constexpr_format Constexpr formato de texto 202511L (C++26) P3391R2
__cpp_lib_constexpr_forward_list Constexpr std::forward_list 202502L (C++26) P3372R3
__cpp_lib_constexpr_functional Constexpr misceláneo de bits (std::default_searcher); constexpr INVOKE 201907L (C++20) P1032R1
P1065R2
__cpp_lib_constexpr_inplace_vector Constexpr std::inplace_vector para tipos no triviales 202502L (C++26) P3074R7
__cpp_lib_constexpr_iterator Constexpr misceláneo de bits (std::insert_iterator y otros) 201811L (C++20) P1032R1
__cpp_lib_constexpr_list Constexpr std::list 202502L (C++26) P3372R3
__cpp_lib_constexpr_map Constexpr std::map y std::multimap 202502L (C++26) P3372R3
__cpp_lib_constexpr_memory Constexpr in std::pointer_traits 201811L (C++20) P1006R1
Constexpr std::unique_ptr 202202L (C++23) P2273R3
Constexpr std::shared_ptr y funciones ‘amigas’ 202506L (C++26) P3037R6
__cpp_lib_constexpr_new Constexpr new de ubicación 202406L (C++26) P2747R2
__cpp_lib_constexpr_numeric Constexpr para algoritmos in <numeric> 201911L (C++20) P1645R1
__cpp_lib_constexpr_queue Constexpr std::queue y std::priority_queue 202502L (C++26) P3372R3
__cpp_lib_constexpr_set Constexpr std::set y std::multiset 202502L (C++26) P3372R3
__cpp_lib_constexpr_stack Constexpr std::stack 202502L (C++26) P3372R3
__cpp_lib_constexpr_string Más constexpr std::char_traits 201611L (C++17) P0426R1
Constexpr std::char_traits completo 201811L (C++20) P1032R1
Constexpr std::string 201907L P0980R1
__cpp_lib_constexpr_string_view Constexpr misceláneo de bits (std::string_view::copy) 201811L (C++20) P1032R1
__cpp_lib_constexpr_tuple Constexpr misceláneo de bits (std::tuple::operator= y otros) 201811L (C++20) P1032R1
__cpp_lib_constexpr_typeinfo Constexpr para std::type_info::operator== 202106L (C++23) P1328R1
__cpp_lib_constexpr_unordered_map Constexpr std::unordered_map y std::unordered_multimap 202502L (C++26) P3372R3
__cpp_lib_constexpr_unordered_set Constexpr std::unordered_set y std::unordered_multiset 202502L (C++26) P3372R3
__cpp_lib_constexpr_utility Constexpr misceláneo de bits (std::pair::operator= y otros.) 201811L (C++20) P1032R1
__cpp_lib_constexpr_vector Constexpr para std::vector 201907L (C++20) P1004R2
__cpp_lib_constrained_equality Operadores relacionales restringidos para std::pair, std::tuple, std::optional y std::variant 202403L (C++26) P2944R3
Restricción de operadores de igualdad para std::expected 202411L P3379R0
__cpp_lib_containers_ranges Construcción e inserción consciente de los rangos para contenedores y cadenas 202202L (C++23) P1206R7
__cpp_lib_contracts <contracts>: Soporte para contratos 202502L (C++26) P2900R14
__cpp_lib_copyable_function std::copyable_function 202306L (C++26) P2548R6
__cpp_lib_coroutine Corrutinas (apoyo de biblioteca) 201902L (C++20) P0912R5
LWG3393
__cpp_lib_counting_scope Ámbitos asíncronos: creación de ámbitos para la concurrencia no secuencial. 202506L (C++26) P3149R11
P3815R1


__cpp_lib_debugging <debugging>: Soporte para depuración 202311L (C++26) P2546R5
std::is_debugger_present reemplazable 202403L P2810R4
__cpp_lib_define_static std::define_static_object, std::define_static_array, std::define_static_string 202506L (C++26) P3491R3
__cpp_lib_destroying_delete Operador delete de destrucción (apoyo de biblioteca) 201806L (C++20) P0722R3
__cpp_lib_enable_shared_from_this Especificación más precisa de std::enable_shared_from_this::weak_from_this 201603L (C++17) P0033R1
__cpp_lib_endian std::endian 201907L (C++20) P0463R1
P1612R1
__cpp_lib_erase_if Borrado uniforme de contenedores 202002L (C++20) P1209R0
P1115R3
__cpp_lib_exchange_function std::exchange 201304L (C++14) N3668
__cpp_lib_exception_ptr_cast std::exception_ptr_cast() 202603L (C++26) P2927R3
P3748R0
P3981R2
__cpp_lib_execution Políticas de ejecución 201603L (C++17) P0024R2
std::execution::unsequenced_policy 201902L (C++20) P1001R2
__cpp_lib_expected Plantilla de clase std::expected 202202L (C++23) P0323R12
Funciones monádicas para std::expected 202211L P2505R5
__cpp_lib_filesystem Biblioteca del sistema de archivos 201703L (C++17) P0218R1
P0219R1
P0392R0
P0317R1
__cpp_lib_flat_map std::flat_map y std::flat_multimap 202207L (C++23) P0429R9
Correcciones de std::flat_map y std::flat_multimap 202511L (C++26) P3567R2
__cpp_lib_flat_set std::flat_set y std::flat_multiset 202207L (C++23) P1222R4
LWG3751
Correcciones de std::flat_set y std::flat_multiset 202511L (C++26) P3567R2
__cpp_lib_format Formateo de texto 201907L (C++20) P0645R10
P1361R2
P1652R1
Comprobaciones de formato de cadena en tiempo de compilación; Reducción de parametrización de std::vformat_to 202106L (C++23)
(DR20)
P2216R3
Corrección del manejo de configuración regional en formateadores de crono; Soporte para tipos no formateables constantes 202110L P2372R3
P2418R2
Expone std::basic_format_string ; aclara el manejo de codificación en formatos regionales de tipos crono. 202207L (C++23) P2419R2
P2508R1
Consejos de formato 202304L (C++26) P2510R3
Comprobación de tipos de argumentos de formato 202305L P2757R3
Miembro visit 202306L P2637R3
Cadenas de formato en tiempo de ejecución 202311L P2918R2
Cambiar nombre de std::runtime_format a std::dynamic_format 202603L P2918R2
__cpp_lib_format_path Formato de std::filesystem::path 202403L (C++26) P2845R8
std::filesystem::path::display_string() y std::filesystem::path::native_encoded_string() 202506L P2319R5
__cpp_lib_format_ranges Formatos de rangos 202207L (C++23) P2286R8
P2585R1
LWG3750
__cpp_lib_format_uchar Corrige formato de las unidades de código cono enteros 202311L (C++26) P2909R4
__cpp_lib_formatters Formato de std::thread::id y std::stacktrace 202302L (C++23) P2693R1
__cpp_lib_forward_like std::forward_like 202207L (C++23) P2445R1
__cpp_lib_freestanding_algorithm Funciones independientes en <algorithm> 202311L (C++26) P2407R5
Biblioteca independiente: <algorithm> 202502L P2976R1
__cpp_lib_freestanding_array Hace que partes de std::array sean independientes 202311L (C++26) P2407R5
__cpp_lib_freestanding_char_traits std::char_traits independiente 202306L (C++26) P2338R4
__cpp_lib_freestanding_charconv Funciones independientes en <charconv> 202306L (C++26) P2338R4
__cpp_lib_freestanding_cstdlib Funciones independientes en <cstdlib> 202306L (C++26) P2338R4
__cpp_lib_freestanding_cstring Funciones independientes en <cstring> 202306L (C++26) P2338R4
Elimina std::strtok de las funciones independientes 202311L P2937R0
__cpp_lib_freestanding_cwchar Funciones independientes en <cwchar> 202306L (C++26) P2338R4
__cpp_lib_freestanding_errc std::errc independiente 202306L (C++26) P2338R4
__cpp_lib_freestanding_execution Biblioteca independiente: <execution> 202502L (C++26) P2976R1
__cpp_lib_freestanding_expected Hace que partes de std::expected sean independientes 202311L (C++26) P2833R2
__cpp_lib_freestanding_feature_test_macros Soporte para macros de prueba de características independiente 202306L (C++26) P2198R7
__cpp_lib_freestanding_functional Funciones independientes en <functional> 202306L (C++26) P2198R7
__cpp_lib_freestanding_iterator Funciones independientes en <iterator> 202306L (C++26) P2198R7
__cpp_lib_freestanding_mdspan std::mdspan independiente 202311L (C++26) P2833R2
__cpp_lib_freestanding_memory Funciones independientes en <memory> 202306L (C++26) P2198R7
Biblioteca independiente: <memory> 202502L P2976R1
__cpp_lib_freestanding_numeric Funciones independientes en <numeric> (aritmética de daturación) 202311L (C++26) P0543R3
Biblioteca independiente: <numeric> 202502L P2976R1
__cpp_lib_freestanding_operator_new Definición de operador new (opcional en implementaciones independientes) 202306L (C++26) P2198R7
__cpp_lib_freestanding_optional Hace que partes de std::optional sean independientes 202311L (C++26) P2407R5
std::optional<T&> independiente 202506L P3836R2
__cpp_lib_freestanding_random Biblioteca independiente: <random> 202502L (C++26) P2976R1
__cpp_lib_freestanding_ranges Funciones independientes en <ranges> 202306L (C++26) P2198R7
__cpp_lib_freestanding_ratio Funciones independientes en <ratio> 202306L (C++26) P2198R7
__cpp_lib_freestanding_string_view Hace que partes de std::string_view sean independientes 202311L (C++26) P2407R5
__cpp_lib_freestanding_tuple Funciones independientes en <tuple> 202306L (C++26) P2198R7
__cpp_lib_freestanding_utility Funciones independientes en <utility> 202306L (C++26) P2198R7
__cpp_lib_freestanding_variant Hace que partes de std::variant sean independientes 202311L (C++26) P2407R5
__cpp_lib_fstream_native_handle Obtención de manejadores nativos a partir de flujos de archivos 202306L (C++26) P1759R6
__cpp_lib_function_ref std::function_ref: Una referencia invocable con tipo borrado 202306L (C++26) P0792R14
__cpp_lib_gcd_lcm std::gcd, std::lcm 201606L (C++17) P0295R0
__cpp_lib_generator std::generator: Generador de corrutina síncrona para rangos 202207L (C++23) P2502R2
__cpp_lib_generic_associative_lookup Búsqueda de comparación heterogénea en los contenedores asociativos 201304L (C++14) N3657
__cpp_lib_generic_unordered_lookup Búsqueda de comparación heterogénea en los contenedores asociativos no ordenados 201811L (C++20) P0919R3
__cpp_lib_hardware_interference_size std::hardware_{constructive, destructive}_interference_size 201703L (C++17) P0154R1
__cpp_lib_has_unique_object_representations std::has_unique_object_representations 201606L (C++17) P0258R2
__cpp_lib_hazard_pointer <hazard_pointer>: Punteros de riesgo 202306L (C++26) P2530R3
__cpp_lib_hive <hive>: un contenedor basado en buckets que reusa ubicaciones de memoria de elementos eliminados 202502L (C++26) P0447R28
__cpp_lib_hypot Sobrecarga de 3 argumentos de std::hypot 201603L (C++17) P0030R1
__cpp_lib_incomplete_container_elements Soporte mínimo de tipos incompletos para std::forward_list, std::list, y std::vector 201505L (C++17) N4510
__cpp_lib_indirect std::indirect 202502L (C++26) P3019R14
__cpp_lib_initializer_list Resuelve inconsistencias en begin/end para std::initializer_list 202511L (C++26)
(DR11)
P3016R6
__cpp_lib_inplace_vector std::inplace_vector: Vector redimensionable dinámicamente con capacidad fija 202406L (C++26) P0843R14
Mejores tipos de retorno. Eliminada la función miembro try_append_range 202603L P3981R2
P4022R0
__cpp_lib_int_pow2 Operaciones enteras de potencias al cuadrado (std::has_single_bit, std::bit_ceil, std::bit_floor, std::bit_width) 202002L (C++20) P0556R3
P1956R1
__cpp_lib_integer_comparison_functions Funciones de comparación de enteros 202002L (C++20) P0586R2
__cpp_lib_integer_sequence Secuencias de enteros en tiempo de compilación 201304L (C++14) N3658
Hace que std::integer_sequence sea utilizable en vínculos estructurados y declaraciones de expansión 202511L (C++26) P1789R3
__cpp_lib_integral_constant_callable std::integral_constant::operator() 201304L (C++14) N3545
__cpp_lib_interpolate std::lerp, std::midpoint 201902L (C++20) P0811R3
__cpp_lib_invoke std::invoke 201411L (C++17) N4169
__cpp_lib_invoke_r std::invoke_r 202106L (C++23) P2136R3
__cpp_lib_ios_noreplace Soporte de modo exclusivo para flujos de datos 202207L (C++23) P2467R1
__cpp_lib_is_aggregate std::is_aggregate 201703L (C++17) LWG2911
__cpp_lib_is_constant_evaluated std::is_constant_evaluated 201811L (C++20) P0595R2
__cpp_lib_is_final std::is_final 201402L (C++14) LWG2112
__cpp_lib_is_implicit_lifetime std::is_implicit_lifetime 202302L (C++23) P2674R1
__cpp_lib_is_invocable std::is_invocable, std::invoke_result 201703L (C++17) P0604R0
__cpp_lib_is_layout_compatible std::is_layout_compatible 201907L (C++20) P0466R5
__cpp_lib_is_nothrow_convertible std::is_nothrow_convertible 201806L (C++20) P0758R1
LWG3356
__cpp_lib_is_null_pointer std::is_null_pointer 201309L (C++14)
(DR11)
LWG2247
__cpp_lib_is_pointer_interconvertible Rasgos de interconvertibilidad de punteros: std::is_pointer_interconvertible_with_class, std::is_pointer_interconvertible_base_of 201907L (C++20) P0466R5
__cpp_lib_is_scoped_enum std::is_scoped_enum 202011L (C++23) P1048R1
__cpp_lib_is_structural std::is_structural: rasgo de tipo para detectar tipos estructurales 202603L (C++26) P3856R8
__cpp_lib_is_sufficiently_aligned std::is_sufficiently_aligned: comprueba una precondición de alineamiento de puntero 202411L (C++26) P2897R7
__cpp_lib_is_swappable Rasgos de intercambio [nothrow-] 201603L (C++17) P0185R1
__cpp_lib_is_virtual_base_of std::is_virtual_base_of: Rasgo de tipo para detectar clases bases virtuales 202406L (C++26) P2985R0
__cpp_lib_is_within_lifetime Comprueba si una unión alternativa está activa (std::is_within_lifetime) 202306L (C++26) P2641R4
Extiende (std::is_within_lifetime) 202603L P3450R1
__cpp_lib_jthread Token de detención e hilo de unión 201911L (C++20) P0660R10
P1869R1
__cpp_lib_latch std::latch 201907L (C++20) P1135R6
__cpp_lib_launder CWG issue 1776: Reemplazo de objetos clase que contienen miembros de tipo referencia (std::launder) 201606L (C++17) P0137R1
__cpp_lib_linalg Una interfaz de álgebra lineal de función libre basada en BLAS 202311L (C++26) P1673R13
__cpp_lib_list_remove_return_type Cambiar el tipo de retorno de remove(), remove_if() y unique() de std::forward_list y std::list 201806L (C++20) P0646R1
__cpp_lib_logical_traits Rasgos de tipo de operadores lógicos 201510L (C++17) P0013R1
__cpp_lib_make_from_tuple std::make_from_tuple 201606L (C++17) P0209R2
__cpp_lib_make_reverse_iterator std::make_reverse_iterator 201402L (C++14) LWG2285
__cpp_lib_make_unique std::make_unique 201304L (C++14) N3656
__cpp_lib_map_try_emplace std::map::try_emplace, std::map::insert_or_assign 201411L (C++17) N4279
__cpp_lib_math_constants Constantes matemáticas 201907L (C++20) P0631R8
__cpp_lib_math_special_functions Funciones especiales de matemáticas 201603L (C++17) P0226R1
__cpp_lib_mdspan std::mdspan 202207L (C++23) P0009R18
P2599R2
P2604R0
P2613R1
std::dims para std::mdspan 202406L (C++26) P2389R2
__cpp_lib_memory_resource std::pmr::memory_resource 201603L (C++17) P0220R1
__cpp_lib_modules Módulos de la biblioteca estándar std y std.compat 202207L (C++23) P2465R3
__cpp_lib_move_iterator_concept Hace que std::move_iterator<T*> sea un iterador de acceso aleatorio 202207L (C++23) P2520R0
__cpp_lib_move_only_function std::move_only_function 202110L (C++23) P0288R9
__cpp_lib_node_extract Unir mapas y conjuntos (std::map::extract, std::map::merge, std::map::insert(node_type), etc) 201606L (C++17) P0083R3
__cpp_lib_nonmember_container_access std::size, std::data y std::empty 201411L (C++17) N4280
__cpp_lib_not_fn std::not_fn 201603L (C++17) P0005R4
Permitir el paso de objetos invocables como argumentos de plantilla sin tipo a std::not_fn 202306L (C++26) P2714R1
__cpp_lib_null_iterators Iteradores de avance nulos 201304L (C++14) N3644
__cpp_lib_observable_checkpoint Soporte de biblioteca para puntos de control observables 202506L (C++26) P1494R5
P3641R0
__cpp_lib_optional std::optional 201606L (C++17) P0220R1
P0032R3
P0307R2
std::optional completamente constexpr 202106L (C++23)
(DR20)
P2231R1
Operaciones monádicas en std::optional 202110L (C++23) P0798R8
LWG3621
std::optional<T&> 202506L (C++26) P2988R12
__cpp_lib_optional_range_support soporte de rango para std::optional 202406L (C++26) P3168R2
__cpp_lib_out_ptr std::out_ptr, std::inout_ptr 202106L (C++23) P1132R8
std::out_ptr, std::inout_ptr idenpendientes 202311L (C++26) P2833R2
__cpp_lib_parallel_algorithm Algoritmos paralelos 201603L (C++17) P0024R2
Algoritmos de rango paralelos 202506L (C++26) P3179R9
P3709R2
__cpp_lib_parallel_scheduler Planificador paralelo 202506L (C++26) P2079R10
P3804R2
__cpp_lib_philox_engine std::philox_engine: Motor de números aleatorios basado en contador 202406L (C++26) P2075R6
__cpp_lib_polymorphic std::polymorphic 202502L (C++26) P3019R14
__cpp_lib_polymorphic_allocator std::pmr::polymorphic_allocator<> como un tipo vocabulario 201902L (C++20) P0339R6
LWG3437
__cpp_lib_print Salida con formato 202207L (C++23) P2093R14
Permite una implementación eficiente de std::print 202403L (C++26)
(DR23)
P3107R5
std::print más tipos más rápidos con menos memoria 202406L P3235R3
__cpp_lib_quoted_string_io std::quoted 201304L (C++14) N3654
__cpp_lib_ranges Biblioteca de rangos y algoritmos restringidos 201911L (C++20) P0896R4
P1035R7
P1716R3
Vistas no inicializables por defecto 202106L (C++23)
(DR20)
P2325R3
Vistas con propiedad 202110L P2415R2
std::ranges::range_adaptor_closure 202202L (C++23) P2387R3
Adaptadores de rango relajados para permitir tipos de solo movimiento 202207L P2494R2
Eliminación de sobrecargas de “píldora venenosa” en ranges::begin, ranges::end, ranges::rbegin, ranges::rend, y ranges::size 202211L P2602R2
Rangos relajados para permitir ciertas proyecciones 202302L P2609R3
Elimina el requisito de referencia común para los conceptos invocables indirectamente 202406L (C++26)
(DR20)
P2997R1
__cpp_lib_ranges_as_const std::const_iterator, std::ranges::as_const_view 202207L (C++23) P2278R4
Hace que std::basic_const_iterator siga la convertibilidad de su tipo subyacente 202311L (C++26) P2836R1
__cpp_lib_ranges_as_input std::ranges::as_input_view 202502L (C++26) P3137R3
P3828R1
__cpp_lib_ranges_as_rvalue std::ranges::as_rvalue_view 202207L (C++23) P2446R2
__cpp_lib_ranges_cache_latest std::ranges::cache_latest_view 202411L (C++26) P3138R5
__cpp_lib_ranges_cartesian_product std::ranges::cartesian_product_view 202207L (C++23) P2374R4
P2540R1
__cpp_lib_ranges_chunk std::ranges::chunk_view 202202L (C++23) P2442R1
__cpp_lib_ranges_chunk_by std::ranges::chunk_by_view 202202L (C++23) P2443R1
__cpp_lib_ranges_concat std::ranges::concat_view 202403L (C++26) P2542R8
__cpp_lib_ranges_contains std::ranges::contains 202207L (C++23) P2302R4
__cpp_lib_ranges_enumerate std::ranges::enumerate_view 202302L (C++23) P2164R9
__cpp_lib_ranges_filter Extensiones de vista de filtro para uso seguro 202603L (C++26)
(DR20)
P3725R3
__cpp_lib_ranges_find_last std::ranges::find_last, std::ranges::find_last_if y std::ranges::find_last_if_not 202207L (C++23) P1223R5
LWG3807
__cpp_lib_ranges_fold std::ranges algoritmos de plegado 202207L (C++23) P2322R6
__cpp_lib_ranges_generate_random API de vecotr para generación de números aleatorios (std::ranges::generate_random) 202403L (C++26) P1068R11
__cpp_lib_ranges_iota std::ranges::iota 202202L (C++23) P2440R1
__cpp_lib_ranges_indices std::views::indices 202506L (C++26) P3060R3
__cpp_lib_ranges_join_with std::ranges::join_with_view 202202L (C++23) P2441R2
__cpp_lib_ranges_repeat std::ranges::repeat_view 202207L (C++23) P2474R2
__cpp_lib_ranges_reserve_hint std::ranges::approximately_sized_range y std::ranges::reserve_hint 202502L (C++26) P2846R6
__cpp_lib_ranges_slide std::ranges::slide_view 202202L (C++23) P2442R1
__cpp_lib_ranges_starts_ends_with std::ranges::starts_with, std::ranges::ends_with 202106L (C++23) P1659R3
__cpp_lib_ranges_stride std::ranges::stride_view 202207L (C++23) P1899R3
__cpp_lib_ranges_to_container std::ranges::to 202202L (C++23) P1206R7
__cpp_lib_ranges_zip std::ranges::zip_view, std::ranges::zip_transform_view, std::ranges::adjacent_view, std::ranges::adjacent_transform_view 202110L (C++23) P2321R2
__cpp_lib_ratio Añade los nuevos prefijos del SI de 2022 202306L (C++26) P2734R0
__cpp_lib_raw_memory_algorithms Extender herramientas de gestión de memoria 201606L (C++17) P0040R3
Constexpr para algoritmos de memoria especializados 202411L (C++26) P3369R0
P3508R0
__cpp_lib_rcu <rcu>: Leer, copiar, actualizar (RCU) 202306L (C++26) P2545R4
__cpp_lib_reference_from_temporary std::reference_constructs_from_temporary y std::reference_converts_from_temporary 202202L (C++23) P2255R2
__cpp_lib_reference_wrapper Comparaciones para std::reference_wrapper 202403L (C++26) P2944R3
__cpp_lib_reflection <meta>: Soporte para la biblioteca de reflexión. Excepciones Constexpr como manejo de errores en reflexión. 202506L (C++26) P2996R13
P3394R4
P3293R3
P3096R12
P3560R2
P3795R2
P4156R0
__cpp_lib_remove_cvref std::remove_cvref 201711L (C++20) P0550R2
__cpp_lib_replaceable_contract_violation_handler Detección de reemplazabilidad definida por la implementación del manejador de violación de contrato mediante macro de características 202603L (C++26) P3886R0
__cpp_lib_result_of_sfinae std::result_of y SFINAE 201210L (C++14) N3462
__cpp_lib_robust_nonmodifying_seq_ops Hacer operaciones de secuencias no modificadoras más robustas (sobrecargas de dos rangos para std::mismatch, std::equal y std::is_permutation) 201304L (C++14) N3671
__cpp_lib_sample std::sample 201603L (C++17) P0220R1
__cpp_lib_saturation_arithmetic Aritmética de saturación 202311L (C++26) P0543R3
Renombrar funciones de aritmética de saturación 202603L (C++26) P4052R0
__cpp_lib_scoped_lock std::scoped_lock 201703L (C++17) P0156R2
__cpp_lib_semaphore std::counting_semaphore, std::binary_semaphore 201907L (C++20) P1135R6
__cpp_lib_senders std::execution: Modelo emisor-receptor de control de ejecución 202406L (C++26) P2300R10
std::execution: Más extensiones 202506L P3388R3
P3396R1
P3433R1
P3481R5
P3570R2
P3682R0
P3887R1
__cpp_lib_shared_mutex std::shared_mutex (no temporizado) 201505L (C++17) N4508
__cpp_lib_shared_ptr_arrays std::shared_ptr<T[]> 201611L (C++17) P0497R0
Soporte de array para std::make_shared 201707L (C++20) P0674R1
__cpp_lib_shared_ptr_weak_type shared_ptr::weak_type 201606L (C++17) P0163R0
__cpp_lib_shared_timed_mutex std::shared_timed_mutex 201402L (C++14) N3891
__cpp_lib_shift std::shift_left y std::shift_right 201806L (C++20) P0769R2
std::ranges::shift_left y std::ranges::shift_right 202202L (C++23) P2440R1
__cpp_lib_simd <simd>: Tipos paralelos de datos 202411L (C++26) P1928R15
__cpp_lib_simd_complex Soporte para valores std::complex intercalados en std::simd 202502L (C++26) P2663R7
__cpp_lib_simd_permutations Operaciones de permutación SIMD 202506L (C++26) P2664R11
__cpp_lib_smart_ptr_for_overwrite Creación de puntero inteligente con inicialización por defecto (std::allocate_shared_for_overwrite, std::make_shared_for_overwrite, std::make_unique_for_overwrite) 202002L (C++20) P1020R1
P1973R1
__cpp_lib_smart_ptr_owner_equality Habilita el uso de std::weak_ptr como clave en unordered associative contenedores 202306L (C++26) P1901R2
__cpp_lib_source_location Captura de información de código fuente (std::source_location) 201907L (C++20) P1208R6
__cpp_lib_span std::span 202002L (C++20) P0122R7
LWG3274
P1024R3
P1976R2
Hace que partes de std::span sean independientes 202311L (C++26) P2821R5
P2833R2
__cpp_lib_spanstream std::spanbuf, std::spanstream 202106L (C++23) P0448R4
__cpp_lib_ssize std::ssize y std::span::size sin signo 201902L (C++20) P1227R2
__cpp_lib_sstream_from_string_view Interfaz de std::stringstream con std::string_view 202306L (C++26) P2495R3
__cpp_lib_stacktrace Listado de pila 202011L (C++23) P0881R7
__cpp_lib_start_lifetime std::start_lifetime 202603L (C++26) P3726R2
__cpp_lib_start_lifetime_as Gestión explícita de tiempo de vida (std::start_lifetime_as) 202207L (C++23) P2590R2
__cpp_lib_starts_ends_with Verificación de prefijo y sufijo de cadenas (starts_with() y ends_with() para std::string y std::string_view) 201711L (C++20) P0457R2
__cpp_lib_stdatomic_h Encabezado de compatibilidad <stdatomic.h> para operaciones atómicas en C 202011L (C++23) P0943R6
__cpp_lib_stdbit_h Encabezado de compatibilidad <stdbit.h> para operaciones sobre bits en C 202603L (C++26) P3370R1
__cpp_lib_stdckdint_h Encabezado de compatibilidad <stdckdint.h> para operaciones enteras comprobadas en C 202603L (C++26) P3370R1
__cpp_lib_string_contains contains() para std::basic_string y std::basic_string_view 202011L (C++23) P1679R3
__cpp_lib_string_subview std::string::subview() y std::string_view::subview() 202506L (C++26) P3044R2
__cpp_lib_string_resize_and_overwrite std::basic_string::resize_and_overwrite 202110L (C++23) P1072R10
__cpp_lib_string_udls Literales definidos por el usuario para tipos cadena 201304L (C++14) N3642
__cpp_lib_string_view std::string_view 201606L (C++17) P0220R1
P0254R2
ConstexprIterator 201803L (C++20) P0858R0
LWG3257
Concatenación de std::string y std::string_view 202403L (C++26) P2591R5
__cpp_lib_submdspan std::submdspan 202306L (C++26) P2630R4
Diseños mdspan separados 202403L P2642R6
__cpp_lib_syncbuf Flujo de salida con búfer sincronizado (std::syncbuf, std::osyncstream) y manipuladores 201803L (C++20) P0053R7
P0753R2
__cpp_lib_task Tipos de tareas de corrutina 202506L (C++26) P3552R3
P3980R1
P3927R2
P3941R4
P4151R1
__cpp_lib_text_encoding std::text_encoding 202306L (C++26) P1885R12
__cpp_lib_three_way_comparison Comparación de tres vías (apoyo de biblioteca); agregar comparación de tres vías a la biblioteca 201907L (C++20) P0768R1
P1614R2
__cpp_lib_to_address Utilería para convertir un puntero a un puntero sin formato (std::to_address) 201711L (C++20) P0653R2
__cpp_lib_to_array std::to_array 201907L (C++20) P0325R4
__cpp_lib_to_chars Conversiones de cadena elementales (std::to_chars, std::from_chars) 201611L (C++17) P0067R5
P0682R1
LWG3137
Pruebas de éxito o fallo para funciones <charconv> 202306L (C++26) P2497R0
__cpp_lib_to_string Redefine std::to_string en términos de std::format 202306L (C++26) P2587R3
__cpp_lib_to_underlying std::to_underlying 202102L (C++23) P1682R3
__cpp_lib_transformation_trait_aliases Plantillas de alias para transformation traits 201304L (C++14) N3655
__cpp_lib_transparent_operators Objetos función de operador transparente (std::less<> y otros) 201210L (C++14) N3421
std::owner_less transparente (std::owner_less<void>) 201510L (C++17) P0074R0
__cpp_lib_tuple_element_t std::tuple_element_t 201402L (C++14) N3887
__cpp_lib_tuple_like Compatibilidad entre std::tuple y objetos de tipo tupla (std::pair, std::array, std::subrange) 202207L (C++23) P2165R4
Añade el protocolo de tupla a std::complex 202311L (C++26) P2819R2
__cpp_lib_tuples_by_type Dirigirse a las tuplas por tipo 201304L (C++14) N3670
__cpp_lib_type_identity std::type_identity 201806L (C++20) P0887R1
__cpp_lib_type_order Ordenación estandarizada de tipo constexpr 202506L (C++26) P2830R10
P3778R0
P4140R0
__cpp_lib_type_trait_variable_templates Plantillas de variable de rasgos de tipo (std::is_void_v, etc) 201510L (C++17) P0006R0
__cpp_lib_uncaught_exceptions std::uncaught_exceptions 201411L (C++17) N4259
__cpp_lib_unordered_map_try_emplace std::unordered_map::try_emplace, std::unordered_map::insert_or_assign 201411L (C++17) N4279
__cpp_lib_unreachable std::unreachable 202202L (C++23) P0627R6
__cpp_lib_unwrap_ref std::unwrap_ref_decay y std::unwrap_reference 201811L (C++20) P0318R1
LWG3348
__cpp_lib_valarray Resuelve inconsistencias en begin/end para std::valarray 202511L (C++26)
(DR11)
P3016R6
__cpp_lib_variant std::variant: una unión de tipo seguro para C++17 201606L (C++17) P0088R3
P0393R3
P0032R3
std::visit para clases derivadas de std::variant 202102L (C++23)
(DR17)
P2162R2
std::variant completamente constexpr 202106L (C++23)
(DR20)
P2231R1
Miembro visit 202306L (C++26) P2637R3
__cpp_lib_void_t std::void_t 201411L (C++17) N3911
Número total de macros: 289


Ejemplo

Uso normal

#ifdef __has_include                           // Comprueba si __has_include está presente
#  if __has_include(<optional>)                // Comprueba si hay una biblioteca estándar
#    include <optional>
#  elif __has_include(<experimental/optional>) // Comprueba una versión experimental
#    include <experimental/optional>
#  elif __has_include(<boost/optional.hpp>)    // Probar con una biblioteca externa
#    include <boost/optional.hpp>
#  else                                        // No se encontró nada
#     error "Falta <optional>"
#  endif
#endif

#ifdef __has_cpp_attribute                      // Comprobar si if __has_cpp_attribute está presente
#  if __has_cpp_attribute(deprecated)           // Comprobar un atributo
#    define DEPRECATED(msg) [[deprecated(msg)]]
#  endif
#endif
#ifndef DEPRECATED
#    define DEPRECATED(msg)
#endif

DEPRECATED("foo() está en desuso") void foo();

#if __cpp_constexpr >= 201304                   // Comprobar una versión específica de una característica
#  define CONSTEXPR constexpr
#else
#  define CONSTEXPR inline
#endif

CONSTEXPR int bar(unsigned i)
{
#if __cpp_binary_literals                       // Comprobar la presencia de una característica
    unsigned mask1 = 0b11000000;
    unsigned mask2 = 0b00000111;
#else
    unsigned mask1 = 0xC0;
    unsigned mask2 = 0x07;
#endif
    if ( i & mask1 )
        return 1;
    if ( i & mask2 )
        return 2;
    return 0;
}

int main()
{
}


Volcado de características del compilador

El siguiente programa vuelca las características y atributos de C++ del compilador.

// Cambia estas opciones para imprimir solo la información necesaria.
static struct PrintOptions {
    constexpr static bool titles               = 1;
    constexpr static bool counters             = 1;
    constexpr static bool attributes           = 1;
    constexpr static bool general_features     = 1;
    constexpr static bool core_features        = 1;
    constexpr static bool lib_features         = 1;
    constexpr static bool supported_features   = 1;
    constexpr static bool unsupported_features = 1;
    constexpr static bool sorted_by_value      = 0;
    constexpr static bool cxx11                = 1;
    constexpr static bool cxx14                = 1;
    constexpr static bool cxx17                = 1;
    constexpr static bool cxx20                = 1;
    constexpr static bool cxx23                = 1;
}   print;

#if __cplusplus < 201100
#  error "Se requiere C++11 o posterior"
#endif

#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <string>

#ifdef __has_include
# if __has_include(<version>)
#   include <version>
# endif
#endif

#define COMPILER_FEATURE_VALUE(value) #value
#define COMPILER_FEATURE_ENTRY(name) { #name, COMPILER_FEATURE_VALUE(name) },

#ifdef __has_cpp_attribute
# define COMPILER_ATTRIBUTE_VALUE_AS_STRING(s) #s
# define COMPILER_ATTRIBUTE_AS_NUMBER(x) COMPILER_ATTRIBUTE_VALUE_AS_STRING(x)
# define COMPILER_ATTRIBUTE_ENTRY(attr) \
  { #attr, COMPILER_ATTRIBUTE_AS_NUMBER(__has_cpp_attribute(attr)) },
#else
# define COMPILER_ATTRIBUTE_ENTRY(attr) { #attr, "_" },
#endif

struct CompilerFeature {
    CompilerFeature(const char* name = nullptr, const char* value = nullptr)
        : name(name), value(value) {}
    const char* name; const char* value;
};

static CompilerFeature cxx_core[] = {
COMPILER_FEATURE_ENTRY(__cplusplus)
COMPILER_FEATURE_ENTRY(__cpp_exceptions)
COMPILER_FEATURE_ENTRY(__cpp_rtti)
#if 0
COMPILER_FEATURE_ENTRY(__GNUC__)
COMPILER_FEATURE_ENTRY(__GNUC_MINOR__)
COMPILER_FEATURE_ENTRY(__GNUC_PATCHLEVEL__)
COMPILER_FEATURE_ENTRY(__GNUG__)
COMPILER_FEATURE_ENTRY(__clang__)
COMPILER_FEATURE_ENTRY(__clang_major__)
COMPILER_FEATURE_ENTRY(__clang_minor__)
COMPILER_FEATURE_ENTRY(__clang_patchlevel__)
#endif
};
static CompilerFeature cxx11_core[] = {
COMPILER_FEATURE_ENTRY(__cpp_alias_templates)
COMPILER_FEATURE_ENTRY(__cpp_attributes)
COMPILER_FEATURE_ENTRY(__cpp_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_decltype)
COMPILER_FEATURE_ENTRY(__cpp_delegating_constructors)
COMPILER_FEATURE_ENTRY(__cpp_inheriting_constructors)
COMPILER_FEATURE_ENTRY(__cpp_initializer_lists)
COMPILER_FEATURE_ENTRY(__cpp_lambdas)
COMPILER_FEATURE_ENTRY(__cpp_nsdmi)
COMPILER_FEATURE_ENTRY(__cpp_range_based_for)
COMPILER_FEATURE_ENTRY(__cpp_raw_strings)
COMPILER_FEATURE_ENTRY(__cpp_ref_qualifiers)
COMPILER_FEATURE_ENTRY(__cpp_rvalue_references)
COMPILER_FEATURE_ENTRY(__cpp_static_assert)
COMPILER_FEATURE_ENTRY(__cpp_threadsafe_static_init)
COMPILER_FEATURE_ENTRY(__cpp_unicode_characters)
COMPILER_FEATURE_ENTRY(__cpp_unicode_literals)
COMPILER_FEATURE_ENTRY(__cpp_user_defined_literals)
COMPILER_FEATURE_ENTRY(__cpp_variadic_templates)
};
static CompilerFeature cxx14_core[] = {
COMPILER_FEATURE_ENTRY(__cpp_aggregate_nsdmi)
COMPILER_FEATURE_ENTRY(__cpp_binary_literals)
COMPILER_FEATURE_ENTRY(__cpp_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_decltype_auto)
COMPILER_FEATURE_ENTRY(__cpp_generic_lambdas)
COMPILER_FEATURE_ENTRY(__cpp_init_captures)
COMPILER_FEATURE_ENTRY(__cpp_return_type_deduction)
COMPILER_FEATURE_ENTRY(__cpp_sized_deallocation)
COMPILER_FEATURE_ENTRY(__cpp_variable_templates)
};
static CompilerFeature cxx14_lib[] = {
COMPILER_FEATURE_ENTRY(__cpp_lib_chrono_udls)
COMPILER_FEATURE_ENTRY(__cpp_lib_complex_udls)
COMPILER_FEATURE_ENTRY(__cpp_lib_exchange_function)
COMPILER_FEATURE_ENTRY(__cpp_lib_generic_associative_lookup)
COMPILER_FEATURE_ENTRY(__cpp_lib_integer_sequence)
COMPILER_FEATURE_ENTRY(__cpp_lib_integral_constant_callable)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_final)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_null_pointer)
COMPILER_FEATURE_ENTRY(__cpp_lib_make_reverse_iterator)
COMPILER_FEATURE_ENTRY(__cpp_lib_make_unique)
COMPILER_FEATURE_ENTRY(__cpp_lib_null_iterators)
COMPILER_FEATURE_ENTRY(__cpp_lib_quoted_string_io)
COMPILER_FEATURE_ENTRY(__cpp_lib_result_of_sfinae)
COMPILER_FEATURE_ENTRY(__cpp_lib_robust_nonmodifying_seq_ops)
COMPILER_FEATURE_ENTRY(__cpp_lib_shared_timed_mutex)
COMPILER_FEATURE_ENTRY(__cpp_lib_string_udls)
COMPILER_FEATURE_ENTRY(__cpp_lib_transformation_trait_aliases)
COMPILER_FEATURE_ENTRY(__cpp_lib_transparent_operators)
COMPILER_FEATURE_ENTRY(__cpp_lib_tuple_element_t)
COMPILER_FEATURE_ENTRY(__cpp_lib_tuples_by_type)
};

static CompilerFeature cxx17_core[] = {
COMPILER_FEATURE_ENTRY(__cpp_aggregate_bases)
COMPILER_FEATURE_ENTRY(__cpp_aligned_new)
COMPILER_FEATURE_ENTRY(__cpp_capture_star_this)
COMPILER_FEATURE_ENTRY(__cpp_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_deduction_guides)
COMPILER_FEATURE_ENTRY(__cpp_enumerator_attributes)
COMPILER_FEATURE_ENTRY(__cpp_fold_expressions)
COMPILER_FEATURE_ENTRY(__cpp_guaranteed_copy_elision)
COMPILER_FEATURE_ENTRY(__cpp_hex_float)
COMPILER_FEATURE_ENTRY(__cpp_if_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_inheriting_constructors)
COMPILER_FEATURE_ENTRY(__cpp_inline_variables)
COMPILER_FEATURE_ENTRY(__cpp_namespace_attributes)
COMPILER_FEATURE_ENTRY(__cpp_noexcept_function_type)
COMPILER_FEATURE_ENTRY(__cpp_nontype_template_args)
COMPILER_FEATURE_ENTRY(__cpp_nontype_template_parameter_auto)
COMPILER_FEATURE_ENTRY(__cpp_range_based_for)
COMPILER_FEATURE_ENTRY(__cpp_static_assert)
COMPILER_FEATURE_ENTRY(__cpp_structured_bindings)
COMPILER_FEATURE_ENTRY(__cpp_template_template_args)
COMPILER_FEATURE_ENTRY(__cpp_variadic_using)
};
static CompilerFeature cxx17_lib[] = {
COMPILER_FEATURE_ENTRY(__cpp_lib_addressof_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_lib_allocator_traits_is_always_equal)
COMPILER_FEATURE_ENTRY(__cpp_lib_any)
COMPILER_FEATURE_ENTRY(__cpp_lib_apply)
COMPILER_FEATURE_ENTRY(__cpp_lib_array_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_lib_as_const)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_is_always_lock_free)
COMPILER_FEATURE_ENTRY(__cpp_lib_bool_constant)
COMPILER_FEATURE_ENTRY(__cpp_lib_boyer_moore_searcher)
COMPILER_FEATURE_ENTRY(__cpp_lib_byte)
COMPILER_FEATURE_ENTRY(__cpp_lib_chrono)
COMPILER_FEATURE_ENTRY(__cpp_lib_clamp)
COMPILER_FEATURE_ENTRY(__cpp_lib_enable_shared_from_this)
COMPILER_FEATURE_ENTRY(__cpp_lib_execution)
COMPILER_FEATURE_ENTRY(__cpp_lib_filesystem)
COMPILER_FEATURE_ENTRY(__cpp_lib_gcd_lcm)
COMPILER_FEATURE_ENTRY(__cpp_lib_hardware_interference_size)
COMPILER_FEATURE_ENTRY(__cpp_lib_has_unique_object_representations)
COMPILER_FEATURE_ENTRY(__cpp_lib_hypot)
COMPILER_FEATURE_ENTRY(__cpp_lib_incomplete_container_elements)
COMPILER_FEATURE_ENTRY(__cpp_lib_invoke)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_aggregate)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_invocable)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_swappable)
COMPILER_FEATURE_ENTRY(__cpp_lib_launder)
COMPILER_FEATURE_ENTRY(__cpp_lib_logical_traits)
COMPILER_FEATURE_ENTRY(__cpp_lib_make_from_tuple)
COMPILER_FEATURE_ENTRY(__cpp_lib_map_try_emplace)
COMPILER_FEATURE_ENTRY(__cpp_lib_math_special_functions)
COMPILER_FEATURE_ENTRY(__cpp_lib_memory_resource)
COMPILER_FEATURE_ENTRY(__cpp_lib_node_extract)
COMPILER_FEATURE_ENTRY(__cpp_lib_nonmember_container_access)
COMPILER_FEATURE_ENTRY(__cpp_lib_not_fn)
COMPILER_FEATURE_ENTRY(__cpp_lib_optional)
COMPILER_FEATURE_ENTRY(__cpp_lib_parallel_algorithm)
COMPILER_FEATURE_ENTRY(__cpp_lib_raw_memory_algorithms)
COMPILER_FEATURE_ENTRY(__cpp_lib_sample)
COMPILER_FEATURE_ENTRY(__cpp_lib_scoped_lock)
COMPILER_FEATURE_ENTRY(__cpp_lib_shared_mutex)
COMPILER_FEATURE_ENTRY(__cpp_lib_shared_ptr_arrays)
COMPILER_FEATURE_ENTRY(__cpp_lib_shared_ptr_weak_type)
COMPILER_FEATURE_ENTRY(__cpp_lib_string_view)
COMPILER_FEATURE_ENTRY(__cpp_lib_to_chars)
COMPILER_FEATURE_ENTRY(__cpp_lib_transparent_operators)
COMPILER_FEATURE_ENTRY(__cpp_lib_type_trait_variable_templates)
COMPILER_FEATURE_ENTRY(__cpp_lib_uncaught_exceptions)
COMPILER_FEATURE_ENTRY(__cpp_lib_unordered_map_try_emplace)
COMPILER_FEATURE_ENTRY(__cpp_lib_variant)
COMPILER_FEATURE_ENTRY(__cpp_lib_void_t)
};

static CompilerFeature cxx20_core[] = {
COMPILER_FEATURE_ENTRY(__cpp_aggregate_paren_init)
COMPILER_FEATURE_ENTRY(__cpp_char8_t)
COMPILER_FEATURE_ENTRY(__cpp_concepts)
COMPILER_FEATURE_ENTRY(__cpp_conditional_explicit)
COMPILER_FEATURE_ENTRY(__cpp_consteval)
COMPILER_FEATURE_ENTRY(__cpp_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_constexpr_dynamic_alloc)
COMPILER_FEATURE_ENTRY(__cpp_constexpr_in_decltype)
COMPILER_FEATURE_ENTRY(__cpp_constinit)
COMPILER_FEATURE_ENTRY(__cpp_deduction_guides)
COMPILER_FEATURE_ENTRY(__cpp_designated_initializers)
COMPILER_FEATURE_ENTRY(__cpp_generic_lambdas)
COMPILER_FEATURE_ENTRY(__cpp_impl_coroutine)
COMPILER_FEATURE_ENTRY(__cpp_impl_destroying_delete)
COMPILER_FEATURE_ENTRY(__cpp_impl_three_way_comparison)
COMPILER_FEATURE_ENTRY(__cpp_init_captures)
COMPILER_FEATURE_ENTRY(__cpp_modules)
COMPILER_FEATURE_ENTRY(__cpp_nontype_template_args)
COMPILER_FEATURE_ENTRY(__cpp_using_enum)
};
static CompilerFeature cxx20_lib[] = {
COMPILER_FEATURE_ENTRY(__cpp_lib_array_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_lib_assume_aligned)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_flag_test)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_float)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_lock_free_type_aliases)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_ref)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_shared_ptr)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_value_initialization)
COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_wait)
COMPILER_FEATURE_ENTRY(__cpp_lib_barrier)
COMPILER_FEATURE_ENTRY(__cpp_lib_bind_front)
COMPILER_FEATURE_ENTRY(__cpp_lib_bit_cast)
COMPILER_FEATURE_ENTRY(__cpp_lib_bitops)
COMPILER_FEATURE_ENTRY(__cpp_lib_bounded_array_traits)
COMPILER_FEATURE_ENTRY(__cpp_lib_char8_t)
COMPILER_FEATURE_ENTRY(__cpp_lib_chrono)
COMPILER_FEATURE_ENTRY(__cpp_lib_concepts)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_algorithms)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_complex)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_dynamic_alloc)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_functional)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_iterator)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_memory)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_numeric)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_string)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_string_view)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_tuple)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_utility)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_vector)
COMPILER_FEATURE_ENTRY(__cpp_lib_coroutine)
COMPILER_FEATURE_ENTRY(__cpp_lib_destroying_delete)
COMPILER_FEATURE_ENTRY(__cpp_lib_endian)
COMPILER_FEATURE_ENTRY(__cpp_lib_erase_if)
COMPILER_FEATURE_ENTRY(__cpp_lib_execution)
COMPILER_FEATURE_ENTRY(__cpp_lib_format)
COMPILER_FEATURE_ENTRY(__cpp_lib_generic_unordered_lookup)
COMPILER_FEATURE_ENTRY(__cpp_lib_int_pow2)
COMPILER_FEATURE_ENTRY(__cpp_lib_integer_comparison_functions)
COMPILER_FEATURE_ENTRY(__cpp_lib_interpolate)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_constant_evaluated)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_layout_compatible)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_nothrow_convertible)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_pointer_interconvertible)
COMPILER_FEATURE_ENTRY(__cpp_lib_jthread)
COMPILER_FEATURE_ENTRY(__cpp_lib_latch)
COMPILER_FEATURE_ENTRY(__cpp_lib_list_remove_return_type)
COMPILER_FEATURE_ENTRY(__cpp_lib_math_constants)
COMPILER_FEATURE_ENTRY(__cpp_lib_polymorphic_allocator)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges)
COMPILER_FEATURE_ENTRY(__cpp_lib_remove_cvref)
COMPILER_FEATURE_ENTRY(__cpp_lib_semaphore)
COMPILER_FEATURE_ENTRY(__cpp_lib_shared_ptr_arrays)
COMPILER_FEATURE_ENTRY(__cpp_lib_shift)
COMPILER_FEATURE_ENTRY(__cpp_lib_smart_ptr_for_overwrite)
COMPILER_FEATURE_ENTRY(__cpp_lib_source_location)
COMPILER_FEATURE_ENTRY(__cpp_lib_span)
COMPILER_FEATURE_ENTRY(__cpp_lib_ssize)
COMPILER_FEATURE_ENTRY(__cpp_lib_starts_ends_with)
COMPILER_FEATURE_ENTRY(__cpp_lib_string_view)
COMPILER_FEATURE_ENTRY(__cpp_lib_syncbuf)
COMPILER_FEATURE_ENTRY(__cpp_lib_three_way_comparison)
COMPILER_FEATURE_ENTRY(__cpp_lib_to_address)
COMPILER_FEATURE_ENTRY(__cpp_lib_to_array)
COMPILER_FEATURE_ENTRY(__cpp_lib_type_identity)
COMPILER_FEATURE_ENTRY(__cpp_lib_unwrap_ref)
};

static CompilerFeature cxx23_core[] = {
//< Continuar poblando
COMPILER_FEATURE_ENTRY(__cpp_constexpr)
COMPILER_FEATURE_ENTRY(__cpp_explicit_this_parameter)
COMPILER_FEATURE_ENTRY(__cpp_if_consteval)
COMPILER_FEATURE_ENTRY(__cpp_multidimensional_subscript)
COMPILER_FEATURE_ENTRY(__cpp_size_t_suffix)
};
static CompilerFeature cxx23_lib[] = {
//< Continuar poblando
COMPILER_FEATURE_ENTRY(__cpp_lib_adaptor_iterator_pair_constructor)
COMPILER_FEATURE_ENTRY(__cpp_lib_allocate_at_least)
COMPILER_FEATURE_ENTRY(__cpp_lib_associative_heterogeneous_erasure)
COMPILER_FEATURE_ENTRY(__cpp_lib_bind_back)
COMPILER_FEATURE_ENTRY(__cpp_lib_byteswap)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_cmath)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_memory)
COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_typeinfo)
COMPILER_FEATURE_ENTRY(__cpp_lib_containers_ranges)
COMPILER_FEATURE_ENTRY(__cpp_lib_expected)
COMPILER_FEATURE_ENTRY(__cpp_lib_format)
COMPILER_FEATURE_ENTRY(__cpp_lib_invoke_r)
COMPILER_FEATURE_ENTRY(__cpp_lib_is_scoped_enum)
COMPILER_FEATURE_ENTRY(__cpp_lib_move_only_function)
COMPILER_FEATURE_ENTRY(__cpp_lib_optional)
COMPILER_FEATURE_ENTRY(__cpp_lib_out_ptr)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_chunk)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_chunk_by)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_iota)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_join_with)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_slide)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_starts_ends_with)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_to_container)
COMPILER_FEATURE_ENTRY(__cpp_lib_ranges_zip)
COMPILER_FEATURE_ENTRY(__cpp_lib_reference_from_temporary)
COMPILER_FEATURE_ENTRY(__cpp_lib_shift)
COMPILER_FEATURE_ENTRY(__cpp_lib_spanstream)
COMPILER_FEATURE_ENTRY(__cpp_lib_stacktrace)
COMPILER_FEATURE_ENTRY(__cpp_lib_stdatomic_h)
COMPILER_FEATURE_ENTRY(__cpp_lib_string_contains)
COMPILER_FEATURE_ENTRY(__cpp_lib_string_resize_and_overwrite)
COMPILER_FEATURE_ENTRY(__cpp_lib_to_underlying)
COMPILER_FEATURE_ENTRY(__cpp_lib_unreachable)
COMPILER_FEATURE_ENTRY(__cpp_lib_variant)
};

static CompilerFeature attributes[] = {
COMPILER_ATTRIBUTE_ENTRY(carries_dependency)
COMPILER_ATTRIBUTE_ENTRY(deprecated)
COMPILER_ATTRIBUTE_ENTRY(fallthrough)
COMPILER_ATTRIBUTE_ENTRY(likely)
COMPILER_ATTRIBUTE_ENTRY(maybe_unused)
COMPILER_ATTRIBUTE_ENTRY(nodiscard)
COMPILER_ATTRIBUTE_ENTRY(noreturn)
COMPILER_ATTRIBUTE_ENTRY(no_unique_address)
COMPILER_ATTRIBUTE_ENTRY(unlikely)
};

constexpr bool is_feature_supported(const CompilerFeature& x) {
    return x.value[0] != '_' && x.value[0] != '0';
}

inline void print_compiler_feature(const CompilerFeature& x) {
    constexpr static int max_name_length = 44; //< Update if necessary
    std::string value{ is_feature_supported(x) ? x.value : "------" };
    if (value.back() == 'L') value.pop_back(); //~ 201603L -> 201603
    // value.insert(4, 1, '-'); //~ 201603 -> 2016-03
    if ( (print.supported_features && is_feature_supported(x))
        or (print.unsupported_features && !is_feature_supported(x))) {
            std::cout << std::left << std::setw(max_name_length)
                      << x.name << " " << value << '\n';
    }
}

template<size_t N>
inline void show(char const* title, CompilerFeature (&features)[N]) {
    if (print.titles) {
        std::cout << '\n' << std::left << title << " (";
        if (print.counters)
            std::cout << std::count_if(
                std::begin(features), std::end(features), is_feature_supported) << '/';
        std::cout << N << ")\n";
    }
    if (print.sorted_by_value) {
        std::sort(std::begin(features), std::end(features),
            [](CompilerFeature const& lhs, CompilerFeature const& rhs) {
                return std::strcmp(lhs.value, rhs.value) < 0;
            });
    }
    for (const CompilerFeature& x : features) {
        print_compiler_feature(x);
    }
}

int main() {
    if (print.general_features) show("C++ GENERAL", cxx_core);
    if (print.cxx11 && print.core_features) show("C++11 CORE", cxx11_core);
    if (print.cxx14 && print.core_features) show("C++14 CORE", cxx14_core);
    if (print.cxx14 && print.lib_features ) show("C++14 LIB" , cxx14_lib);
    if (print.cxx17 && print.core_features) show("C++17 CORE", cxx17_core);
    if (print.cxx17 && print.lib_features ) show("C++17 LIB" , cxx17_lib);
    if (print.cxx20 && print.core_features) show("C++20 CORE", cxx20_core);
    if (print.cxx20 && print.lib_features ) show("C++20 LIB" , cxx20_lib);
    if (print.cxx23 && print.core_features) show("C++23 CORE", cxx23_core);
    if (print.cxx23 && print.lib_features ) show("C++23 LIB" , cxx23_lib);
    if (print.attributes) show("ATTRIBUTES", attributes);
}

Posible salida:

C++ GENERAL (3/3)
__cplusplus                                  202002
__cpp_exceptions                             199711
__cpp_rtti                                   199711

C++11 CORE (19/19)
__cpp_alias_templates                        200704
__cpp_attributes                             200809
__cpp_constexpr                              201907
__cpp_decltype                               200707
__cpp_delegating_constructors                200604
__cpp_inheriting_constructors                201511
__cpp_initializer_lists                      200806
__cpp_lambdas                                200907
__cpp_nsdmi                                  200809
__cpp_range_based_for                        201603
__cpp_raw_strings                            200710
__cpp_ref_qualifiers                         200710
__cpp_rvalue_references                      200610
__cpp_static_assert                          201411
__cpp_threadsafe_static_init                 200806
__cpp_unicode_characters                     200704
__cpp_unicode_literals                       200710
__cpp_user_defined_literals                  200809
__cpp_variadic_templates                     200704

C++14 CORE (9/9)
__cpp_aggregate_nsdmi                        201304
__cpp_binary_literals                        201304
__cpp_constexpr                              201907
__cpp_decltype_auto                          201304
__cpp_generic_lambdas                        201707
__cpp_init_captures                          201803
__cpp_return_type_deduction                  201304
__cpp_sized_deallocation                     ------
__cpp_variable_templates                     201304

... truncado ...

Informe de defectos

Los siguientes informes de defectos de cambio de comportamiento se aplicaron de manera retroactiva a los estándares de C++ publicados anteriormente.

ID Aplicado a Comportamiento según lo publicado Comportamiento correcto
P2552R3 C++20 __has_cpp_attribute debe expandirse a un valor distinto de cero para los atributos estándar se puede expandir a 0

Véase también

Macros de prueba de características de biblioteca (C++20) definidas en la cabecera <version>
Símbolos de Macro Predefinidos
Índice de Símbolos de Macro

Enlaces externos

  El documento oficial sobre Recomendaciones de Prueba de Características
  Código fuente para volcar las características del compilador