C++ 2011ISO C++2011
This table is based on the table of contents of ISO/IEC
JTC1 SC22 WG21 Doc No: N3290 Date: 2011-04-11
Final Draft International Standard, Standard for Programming Language C++
In this implementation -std=gnu++11 or
-std=c++11 flags must be used to enable language
and library
features. See dialect
options. The pre-defined symbol
__cplusplus is used to check for the
presence of the required flag.
This page describes the C++11 support in mainline GCC SVN, not in any
particular release.
C++ 2011 Implementation StatusSectionDescriptionStatusComments18Language support18.1GeneralY18.2TypesY18.3Implementation properties18.3.2Numeric Limits18.3.2.3Class template numeric_limitsY18.3.2.4numeric_limits membersY18.3.2.5float_round_styleN18.3.2.6float_denorm_styleN18.3.2.7numeric_limits specializationsY18.3.3C LibraryY18.4Integer types18.4.1Header <cstdint> synopsisY18.5Start and terminationPartialC library dependency for quick_exit, at_quick_exit18.6Dynamic memory managementY18.7Type identification18.7.1Class type_infoY18.7.2Class bad_castY18.7.3Class bad_typeidY18.8Exception handling18.8.1Class exceptionY18.8.2Class bad_exceptionY18.8.3Abnormal terminationY18.8.4uncaught_exceptionY18.8.5Exception PropagationY18.8.6nested_exceptionY18.9Initializer lists18.9.1Initializer list constructorsY18.9.2Initializer list accessY18.9.3Initializer list range accessY18.10Other runtime supportY19Diagnostics19.1GeneralY19.2Exception classesY19.3AssertionsY19.4Error numbersY19.5System error support19.5.1Class error_categoryY19.5.2Class error_codeY19.5.3Class error_conditionY19.5.4Comparison operatorsY19.5.5Class system_errorY20General utilities20.1General20.2Utility components20.2.1OperatorsY20.2.2SwapY20.2.3forward and move helpersY20.2.4Function template declvalY20.3Pairs20.3.1In general20.3.2Class template pairY20.3.3Specialized algorithmsY20.3.4Tuple-like access to pairY20.3.5Piecewise constructionY20.4Tuples20.4.1In general20.4.2Class template tuple20.4.2.1ConstructionY20.4.2.2AssignmentY20.4.2.3SwapY20.4.2.4Tuple creation functionsY20.4.2.5Tuple helper classesY20.4.2.6Element accessY20.4.2.7Relational operatorsY20.4.2.8Tuple traitsY20.4.2.9Tuple specialized algorithmsY20.5Class template bitsetY20.5.1bitset constructorsY20.5.2bitset membersY20.5.3bitset hash supportY20.5.4bitset operatorsY20.6Memory20.6.1In general20.6.2Header <memory> synopsis20.6.3Pointer traitsY20.6.4Pointer safetyPartial20.6.5AlignY20.6.6Allocator argument tagY20.6.7uses_allocatorY20.6.8Allocator traitsY20.6.9The default allocatorY20.6.10Raw storage iteratorY20.6.11Temporary buffersY20.6.12Specialized algorithms20.6.12.1addressofY20.6.12.2uninitialized_copyY20.6.12.3uninitialized_fillY20.6.12.4uninitialized_fill_nY20.6.13C libraryY20.7Smart pointers20.7.1Class template unique_ptrY20.7.2Shared-ownership pointersY20.7.2.1Class bad_weak_ptrY20.7.2.2Class template shared_ptrY
Uses code from
boost::shared_ptr.
20.7.2.3Class template weak_ptrY20.7.2.4Class template emable_shared_from_thisY20.7.2.5shared_ptr atomic accessY20.7.2.6Smart pointer hash supportY20.8Function objects20.8.1Definitions20.8.2Requirements20.8.3Class template reference_wrapperY20.8.4Arithmetic operationY20.8.5ComparisonsY20.8.6Logical operationsY20.8.7Bitwise operationsY20.8.8NegatorsY20.8.9Function template bindY20.8.10Function template mem_fnY20.8.11Polymorphic function wrappers20.8.11.1Class bad_function_callY20.8.11.2Class template functionPartialMissing allocator support20.8.12Class template hashY20.9Metaprogramming and type traits20.9.1RequirementsY20.9.2Header <type_traits> synopsis20.9.3Helper classesY20.9.4Unary Type TraitsY20.9.4.1Primary type categoriesY20.9.4.2Composite type traitsY20.9.4.3Type propertiesY20.9.5Type property queriesY20.9.6Relationships between typesY20.9.7Transformations between types20.9.7.1Const-volatile modificationsY20.9.7.2Reference modificationsY20.9.7.3Sign modificationsY20.9.7.4Array modificationsY20.9.7.5Pointer modificationsY20.9.7.6Other transformationsY20.10Compile-time rational arithmetic20.10.1In general20.10.2Header <ratio> synopsis20.10.3Class template ratioY20.10.4Arithmetic on ratiosY20.10.5Comparison of ratiosY20.10.6SI types for ratioY20.11Time utilities20.11.3Clock requirementsY20.11.4Time-related traits20.11.4.1treat_as_floating_pointY20.11.4.2duration_valuesY20.11.4.3Specializations of common_typeY20.11.5Class template durationY20.11.6Class template time_pointY20.11.7Clocks20.11.7.1Class system_clockY20.11.7.2Class steady_clockY20.11.7.3Class high_resolution_clockY20.11.8Date and time functionsY20.12Scoped allocator adaptorY20.12.1Header <scoped_allocator> synopsis20.12.2Scoped allocator adaptor member typesY20.12.3Scoped allocator adaptor constructorsY20.12.4Scoped allocator adaptor membersPartialOUTERMOST is not recursive.20.12.5Scoped allocator operatorsY20.13Class type_indexY21Strings21.1GeneralY21.2Character traits21.2.1Character traits requirementsY21.2.2traits typedefsY21.2.3char_traits specializations21.2.3.1struct char_traits<char>Y21.2.3.2struct char_traits<char16_t>Y21.2.3.3struct char_traits<char32_t>Y21.2.3.4struct char_traits<wchar_t>Y21.3String classesY21.4Class template basic_stringY21.5Numeric ConversionsY21.6Hash supportY21.7Null-terminated sequence utilitiesPartialC library dependency.
Missing <cuchar>22Localization22.1GeneralY22.2Header <locale> synopsisY22.3Locales22.3.1Class localeY22.3.2locale globalsY22.3.3Convenience interfaces22.3.3.1Character classificationY22.3.3.2Conversions22.3.3.2.1Character conversionsY22.3.3.2.2string conversionsY22.3.3.2.3Buffer conversionsY22.4Standard locale categories22.4.1The ctype categoryY22.4.2The numeric category22.4.2.1num_getY22.4.2.2num_putY22.4.3The numeric punctuation facetY22.4.4The collate categoryY22.4.5The time category22.4.5.1Class template time_getY22.4.5.2Class template time_get_bynameY22.4.5.3Class template time_putY22.4.5.3Class template time_put_bynameY22.4.6The monetary category22.4.6.1Class template money_getY22.4.6.2Class template money_putY22.4.6.3Class template money_punctY22.4.6.4Class template money_punct_bynameY22.4.7The message retrieval categoryY22.4.8Program-defined facetsY22.5Standard code conversion facetsY22.6C Library LocalesY23Containers23.1General23.2Container requirements23.2.1General container requirementsPartiallist does not meet the requirements
relating to allocator use and propagation.23.2.2Container data racesY23.2.3Sequence containersY23.2.4Associative containersY23.2.5Unordered associative containersY23.3Sequence containers23.3.2Class template arrayY23.3.3Class template dequeY23.3.4Class template forward_listY23.3.5Class template listPartialIncomplete allocator support.23.3.6Class template vectorY23.3.7Class vector<bool>Y23.4Associative containers23.4.4Class template mapY23.4.5Class template multimapY23.4.6Class template setY23.4.7Class template multisetY23.5Unordered associative containers23.5.4Class template unordered_mapY23.5.5Class template unordered_multimapY23.5.6Class template unordered_setY23.5.7Class template unordered_multisetY23.6Container adaptors23.6.1Class template queueY23.6.2Class template priority_queueY23.6.3Class template stackY24Iterators24.1GeneralY24.2Iterator requirementsY24.3Header <iterator> synopsisY24.4Iterator primitivesY24.5Iterator adaptors24.5.1Reverse iteratorsY24.5.2Insert iteratorsY24.5.3Move iteratorsY24.6Stream iterators24.6.1Class template istream_iteratorY24.6.2Class template ostream_iteratorY24.6.3Class template istreambuf_iteratorY24.6.4Class template ostreambuf_iteratorY24.6.5range accessY25Algorithms25.1General25.2Non-modifying sequence operationsY25.3Mutating sequence operationsY25.4Sorting and related operationsY25.5C library algorithmsY26Numerics26.1GeneralY26.2Numeric type requirementsY26.3The floating-point environmentY26.4Complex numbersY26.5Random number generation26.5.1Requirements26.5.2Header <random> synopsis26.5.3Random number engine class templates26.5.3.1Class template linear_congruential_engineY26.5.3.2Class template mersenne_twister_engineY26.5.3.3Class template subtract_with_carry_engineY26.5.4Random number engine adaptor class templates26.5.4.2Class template discard_block_engineY26.5.4.3Class template independent_bits_engineY26.5.4.4Class template shuffle_order_engineY26.5.5Engines and engine adaptors with predefined parametersY26.5.6Class random_deviceY26.5.7Utilities26.5.7.1Class seed_seqY26.5.7.2Function template generate_canonicalY26.5.8Random number distribution class templates26.5.8.2Uniform distributions26.5.8.2.1Class template uniform_int_distributionY26.5.8.2.2Class template uniform_real_distributionY26.5.8.3Bernoulli distributions26.5.8.3.1Class bernoulli_distributionY26.5.8.3.2Class template binomial_distributionY26.5.8.3.3Class template geometric_distributionY26.5.8.3.4Class template negative_binomial_distributionY26.5.8.4Poisson distributions26.5.8.4.1Class template poisson_distributionY26.5.8.4.2Class template exponential_distributionY26.5.8.4.3Class template gamma_distributionY26.5.8.4.4Class template weibull_distributionY26.5.8.4.5Class template extreme_value_distributionY26.5.8.5Normal distributions26.5.8.5.1Class template normal_distributionY26.5.8.5.2Class template lognormal_distributionY26.5.8.5.3Class template chi_squared_distributionY26.5.8.5.4Class template cauchy_distributionY26.5.8.5.5Class template fisher_f_distributionY26.5.8.5.6Class template student_t_distributionY26.5.8.6Sampling distributions26.5.8.6.1Class template discrete_distributionY26.5.8.6.2Class template piecewise_constant_distributionY26.5.8.6.3Class template piecewise_linear_distributionY26.6Numeric arrays26.6.1Header <valarray> synopsisY26.6.2Class template valarrayY26.6.3valarray non-member operationsY26.6.4Class sliceY26.6.5Class template slice_arrayY26.6.6The gslice classY26.6.7Class template gslice_arrayY26.6.8Class template mask_arrayY26.6.9Class template indirect_arrayY26.6.10valarray range accessY26.7Generalized numeric operations26.7.1Header <numeric> synopsisY26.7.2accumulateY26.7.3inner_productY26.7.4partial_sumY26.7.5adjacent_differenceY26.7.6iotaY26.8C LibraryY27Input/output library27.1GeneralY27.2Iostreams requirementsY27.2.1Imbue LimitationsY27.2.2Positioning Type LimitationsY27.2.3Thread safetyPartial27.3Forward declarationsY27.4Standard iostream objectsY27.4.1OverviewY27.4.2Narrow stream objectsY27.4.3Wide stream objectsY27.5Iostreams base classesY27.6Stream buffersY27.7Formatting and manipulatorsY27.8String-based streamsY27.9File-based streamsY28Regular expressions28.1GeneralY28.2DefinitionsY28.3RequirementsY28.4Header <regex> synopsisY28.5Namespace std::regex_constantsY28.6Class regex_errorY28.7Class template regex_traitsPartialtransform_primary is not correctly implemented28.8Class template basic_regexY28.9Class template sub_matchY28.10Class template match_resultsY28.11Regular expression algorithmsY28.12Regular expression IteratorsY28.13Modified ECMAScript regular expression grammarY29Atomic operations29.1GeneralY29.2Header <atomic> synopsisY29.3Order and consistencyPartial29.4Lock-free propertyY29.5Atomic typesY29.6Operations on atomic typesY29.7Flag Type and operationsY29.8FencesY30Thread support30.1GeneralY30.2RequirementsY30.3Threads30.3.1Class threadPartialthread::id comparisons not well-defined30.3.2Namespace this_threadY30.4Mutual exclusion30.4.1Mutex requirements30.4.1.1In general30.4.1.2Mutex types30.4.1.2.1Class mutexY30.4.1.2.2Class recursive_mutexY30.4.1.3Timed mutex typesOn POSIX sytems these types are only defined if the OS
supports the POSIX Timeouts option. 30.4.1.3.1Class timed_mutexY30.4.1.3.2Class recursive_timed_mutexY30.4.2Locks30.4.2.1Class template lock_guardY30.4.2.2Class template unique_lockY30.4.3Generic locking algorithmsY30.4.4Call once30.4.4.1Struct once_flagY30.4.4.2Function call_onceY30.5Condition variablesY30.5.1Class condition_variableY30.5.2Class condition_variable_anyY30.6Futures30.6.1Overview30.6.2Error handlingY30.6.3Class future_errorY30.6.4Shared stateY30.6.5Class template promiseY30.6.6Class template futureY30.6.7Class template shared_futureY30.6.8Function template asyncY30.6.9Class template packaged_taskYAppendix DCompatibility featuresD.1Increment operator with bool operandD.2register keywordD.3Implicit declaration of copy functionsD.4Dynamic exception specificationsD.5C standard library headersD.6Old iostreams membersD.7char* streamsD.8Function objectsD.9BindersD.10auto_ptrD.11Violating exception-specifications
Implementation Specific BehaviorFor behaviour which is also specified by the 1998 and 2003 standards,
see C++ 1998/2003 Implementation
Specific Behavior. This section only documents behaviour which
is new in the 2011 standard.
20.7.2.2.1 [util.smartptr.shared.const]
Only bad_alloc (or types derived from it) will
be thrown.
20.8.9.1.3 [func.bind.place]/1 There are 29
placeholders defined and the placeholder types are
CopyAssignable.
21.2.3.2 [char.traits.specializations.char16_t],
21.2.3.3 [char.traits.specializations.char32_t]
The types u16streampos and
u32streampos are both synonyms for
fpos<mbstate_t>.
The function eof returns int_type(-1).
22.4.5.1.2 [locale.time.get.virtuals],
22.4.5.3.2 [locale.time.put.virtuals]
Additional supported formats should be documented here.
22.4.7.1.2 [locale.messages.virtuals]
The mapping should be documented here.
23.5.4.2 [unord.map.cnstr],
23.5.5.2 [unord.multimap.cnstr],
23.5.6.2 [unord.set.cnstr],
23.5.7.2 [unord.multiset.cnstr]
The default minimal bucket count is 0 for the default constructors, range
constructors and initializer-list constructors.
25.3.12 [alg.random.shuffle]
The two-argument overload of random_shuffle
uses rand as the source of randomness.
26.5.5 [rand.predef]
The type default_random_engine is a synonym for
minstd_rand0.
26.5.6 [rand.device]
The default token argument to the
random_device constructor is
"default". Other valid arguments are
"/dev/random" and "/dev/urandom",
which determine the character special file to read random bytes from.
The "default" token will read bytes from a hardware
RNG if available (currently this only supports the IA-32 RDRAND
instruction) otherwise it is equivalent to
"/dev/urandom".
An exception of type runtime_error will be
thrown if a random_device object cannot open
or read from the source of random bytes.
26.5.8.1 [rand.dist.general]
The algorithms used by the distributions should be documented here.
26.8 [c.math] Whether the
rand function introduces data races depends on
the C library as the function is not provided by libstdc++.
28.5.1 [re.synopt],
28.5.2 [re.matchflag] ,
28.5.3 [re.err] syntax_option_type, match_flag_type
and error_type are unscoped enumeration types.
28.7 [re.traits]
The blank character class corresponds to the
ctype_base::blank mask.
30.2.3 [thread.req.native]/1native_handle_type and
native_handle are provided. The handle types
are defined in terms of the Gthreads abstraction layer.
thread: The native handle type is
a typedef for __gthread_t i.e. pthread_t
when GCC is configured with the posix thread
model. The value of the native handle is undefined for a thread
which is not joinable.
mutex and
timed_mutex:
The native handle type is __gthread_mutex_t* i.e.
pthread_mutex_t* for the posix
thread model.
recursive_mutex and
recursive_timed_mutex:
The native handle type is __gthread_recursive_mutex_t*
i.e. pthread_mutex_t* for the posix
thread model.
condition_variable: The native
handle type is __gthread_cond_t* i.e.
pthread_cond_t* for the posix
thread model.
30.6.1 [futures.overview]/2launch is a scoped enumeration type with
overloaded operators to support bitmask operations. There are no
additional bitmask elements defined.