-
Notifications
You must be signed in to change notification settings - Fork 19
StandardUsing.en US
This is the page concerning which subset of the standard features could be used in this project.
Several C++0x features are used since 2011-05-03, build 206. These features are also in ISO C++11(ISO/IEC 14882:2011). Previously C++03 with TR1(ISO/IEC TR 19768:2007) was used.
C++11 is now default to conform. All C++03 features conflicted with C++11 are forbidden. TR1 features are avoided and substituted by their C++11 counterparts as possible.
However, the codebase is still largely based on C++03(ISO/IEC 14882:2003).
Some core language feature have be fallback in C++03 (e.g. constexpr
) or library (e.g. alignof
), mostly workaround in ydef.h
, as well as some optional extensions (e.g. __has_feature
and __builtin_expect
) wrapped as implementation details.
Following are the features introduced explicitly to clearify dependences on the language implementations. The date is in UTC+8.
C++11 core language features and headers below now could be used.
See Documentation::Designation[Designation.txt, zh-CN] @ 1.3.2.1 .
New headers from C++11 used:
-
<array>
(since b218[2011-06-14]) -
<chrono>
(since b291[2012-03-07]) -
<forward_list>
(since b218[2011-06-14]) -
<type_traits>
(since b206[2011-05-03]) -
<typeindex>
(since b468[2014-01-20]) -
<tuple>
(since b206[2011-05-03]) -
<system_error>
(since b476[2014-02-16]) -
<unordered_map>
(since b206[2011-05-03]) -
<unordered_set>
(since b206[2011-05-03])
For all implementations supporting multithreading, these headers are also used:
-
<atomic>
(since b328[2011-07-25]; for platform MinGW32 since b299[2013-04-08]) -
<condition_variable>
(since b328[2011-07-25]; for platform MinGW32 since b299[2013-04-08]) -
<future>
(since b520[2014-07-23]) -
<mutex>
(since b328[2011-07-25]; for platform MinGW32 since b299[2013-04-08]) -
<thread>
(since b328[2011-07-25]; for platform MinGW32 since b299[2013-04-08])
Note: LWG1360 specified single-threaded program should be able to use <atomic>
, and resolved by N3256. However, the current YSLib doesn't require it for single-threaded programs.
Other C++11 core and library features used:
- CWG226: Default template arguments for function templates (since b387[2013-03-11])
-
CWG339: Overload resolution in operand of
sizeof
in constant expression (since b591[2015-04-10]) - CWG382: Allow typename outside of templates (b421[2013-07-03])
-
CWG1104: Global-scope template arguments vs the
<:
digraph (since b493[2014-04-16]) - LWG534: Missing basic_string members (since b315[2012-06-08])
-
LWG993:
_Exit
needs better specification (since b565[2015-01-16]) -
LWG1040: Make
integral_constant
objects useable inintegral-constant-expression
s (since b590[2015-04-10]) -
LWG1040: Clarify possible sameness of associative container's iterator and
const_iterator
(since b496[2014-05-01]) -
LWG1255:
declval
should be added to the library (since b260[2011-11-14]) -
LWG1382:
pair
andtuple
constructors should forward arguments (since b206[2011-05-03]) - N1653: Working draft changes for C99 preprocessor synchronization (since b257[2011-11-04]; used GCC extensions previously for variadic macros and empty macro arguments only)
- N1720: Proposal to Add Static Assertions to the Core Language (Revision 3) (since b206[2011-05-03])
- N1757: Right Angle Brackets (Revision 1) (since b206[2011-05-03])
-
N1811: Adding the
long long
type to C++ (Revision 3) (since b206[2011-05-03]) - N1836: Draft Technical Report on C++ Library Extensions (Built-in type traits) (since b206[2011-05-03])
-
cbegin
/cend
/crbegin
/crend
from N1913: A Proposal to Improveconst_iterator
Use (version 2) (since b206[2011-05-03]) -
auto
-typed variables from N1984: Deducing the type of variable from its initializer expression (revision 4) (since b206[2011-05-03]) - N1986: Delegating Constructors (revision 3) (since b311[2011-05-25])
- N1987: Adding "extern template" (version 2) (since b206[2011-05-03])
-
N2235: Generalized Constant Expressions—Revision 5 (since b246[2011-09-23]; i.e.
constexpr
) - N2242: Proposed Wording for Variadic Templates (Revision 2) (since b251[2011-10-08])
- N2249: New Character Types in C++ (since b253[2011-10-18])
- N2258: Templates Aliases (since b433[2013-08-01])
- features except
std::aligned_union
from N2341: (i.e.alignof
): Adding Alignment Support to the C++ Programming Language / Wording (b315[2012-06-08])-
std::tr1::aligned_storage
used since b175[2010-12-23] - compatible
std::aligned_storage
used since b206[2011-05-03]
-
- N2343: Decltype (revision 7) (since b206[2011-05-03])
- N2346: Defaulted and Deleted Functions (since b207[2011-05-05])
- N2347: Strongly Typed Enums (revision 3) (since b261[2011-11-19])
-
N2350: Container
insert
/erase
and iterator constness (Revision 1) (since b531[2014-08-31]) -
N2431: A name for the null pointer:
nullptr
(revision 4) (since b206[2011-05-03]; compatible layer introduced since b204[2011-04-26]) - N2437: Explicit Conversion Operator Draft Working Paper (revision 3) (since b260[2011-11-15])
-
N2439: Extending move semantics to
*this
(revised wording) (since b591[2015-04-11]) - Unicode string literals from N2442: Raw and Unicode String Literals; Unified Proposal (Rev. 2) (since b253[2011-10-18])
- N2442: Raw and Unicode String Literals; Unified Proposal (Rev. 2) (since b434[2013-08-04])
-
N2535: Namespace Association ("
inline namespace
") (since b427[2013-07-11]) - N2540: Inheriting Constructors (revision 5) (since b538[2014-09-24])
- N2541: New Function Declarator Syntax Wording (since b207[2011-05-05])
- N2541: Unrestricted Unions (Revision 2) (since b569[2015-01-29])
-
N2559: Nesting Exception Objects (Revision 1) (since b477[2014-02-19])
-
CWG819:
rethrow_if_nested
(since b477[2014-02-19])
-
CWG819:
- N2634: Solving the SFINAE problem for expressions (since b591[2015-04-10])
- N2672: Initializer List proposed wording (since b297[2012-03-27])
- N2756: Non-static data member initializers (since b360[2013-04-29])
-
N2844: Fixing a Safety Problem with Rvalue References: Proposed Wording (Revision 1) (since b206[2011-05-03])
- CWG1138: Rvalue-ness check for rvalue reference binding is wrong (since b206[2011-05-03])
- N2927: New wording for C++0x Lambdas (rev. 2) (since b206[2011-05-03])
- N2930: Range-Based For Loop Wording (Without Concepts) (since b316[2011-06-11])
-
N3050: Allowing Move Constructors to Throw (Rev. 1) (since b319[2012-06-24]; i.e.
noexcept
andstd::move_if_noexcept
) - N3052: Converting Lambdas to Function Pointers (since b360[2012-12-07])
- features except in
<type_traits>
from N3053: Defining Move Special Member Functions (since b230[2011-08-07]) - N3143: Proposed wording for US 90 (since b206[2011-05-03])
-
N3272: Follow-up on
override
control (since b311[2011-05-25])
Beyond C++11 core and library features used conditionally: