User:Fruderica
A Chinese C/C++ learner.
Contents |
Special Symbols in C
Feature test macros (not done) |
---|
Core:
Library:
TR/TS:
|
User-defined macros (not done) |
---|
Library:
TR/TS:
|
Other items (done) |
---|
Other prederined macros: Special identifiers:
Predefined objects:
Special user-defined functions: |
Macro Issue
- {{mark macro const}} (macro constant)
- Macros expanding to expressions of pointer types (such as stdin and FE_DFL_ENV) are not required to be address constant expression (even not required to be unmodifiable?).
- Format string macros expand to string literals. However, string literals are not classified as constant expressions, even though they can be static objects themselves or initializers of static objects.
- {{mark macro var}} (macro variable) (suggested)
- What's "variable" in C?
- "Variable" in The C Programming Language (K&R C) is identical to "object"
("string literal" may be a variable). - "Variable" in C++ means "declared objects and declared references that are not non-static data members", which means "named objects and their subobjects" in C only as there are not reference types in C
("string literal" is not a variable; subset of K&R's definition). - "Variable" in VLA means "nonconstant"
(determined in run time; unmodifiable in run time; not required to be an lvalue). - "Variable" in variable arguments means "number of function arguments may be different"
(determined in compile time; unmodifiable in run time; even not an expression). - Condition variables are not likely to be related to the issue...
- errno meets K&R's definition.
- MB_CUR_MAX is probably to meet "nonconstant" and not a lvalue.
- It is unspecified that whether RSIZE_MAX expands to a lvalue expression!
- {{mark macro str}} (macro string)
- Should this be used?
Macros | Is modifiable lvalue? | Is constant expression? | Treated as constant? |
stdin stdout stderr FE_DFL_ENV |
Unspecified | Unspecified | Yes |
RSIZE_MAX | Unspecified | Unspecified | Unknown |
errno | Yes | No | No |
MB_CUR_MAX | Probably no | No | No |
Exception specification issues
I think we can say that - an entity is non-throwing (or formally, having a non-throwing exception specification for function and relative variable) if and only if its set of potential exceptions is empty.
However, "set of potential exceptions" is redundant and no longer used since C++17, though it is still well-defined, while "non-throwing/potentially-throwing" is insufficient in revisions earlier than C++17.
Exposition-only items
Functions
voidify
template<class T> void* __voidify(T& obj) noexcept; |
||
Returns const_cast<void*>(static_cast<const volatile void*>(std::addressof(obj))).
INVOKE
This section is incomplete |
Equivalent to std::invoke(), except that it may be used in a constant expression?
FUN
void _FUN(T&) noexcept; |
(1) | |
void _FUN(T&&) = delete; |
(2) | |
Declaration only. They reject rvalue argument, and are used by some wrappers.
Compiler support issues
A lot of patch/DR/DR-like papers.
C++11 core
- N2634 Expression SFINAE; for some old compilers
C++11 library
Almost all C++11 library features are missing.
- Library support for Unicode characters N2249 N1040 (WG14)
- Library support for atomic operations N2427
- Library support for intializer list N2672
- TR1 N1836 (added in 2006-04)
- C99 standard library
- Type traits
- Unordered containers
-
array
-
tuple
-
shared_ptr
andweak_ptr
- Regular expression library
-
function
,referenc_wrapper
, etc. - Random number generation N2111