Namespaces
Variants
Actions

User:Fruderica

From cppreference.com

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

  • 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.
  • What's "variable" in C?
  1. "Variable" in The C Programming Language (K&R C) is identical to "object"
    ("string literal" may be a variable).
  2. "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).
  3. "Variable" in VLA means "nonconstant"
    (determined in run time; unmodifiable in run time; not required to be an lvalue).
  4. "Variable" in variable arguments means "number of function arguments may be different"
    (determined in compile time; unmodifiable in run time; even not an expression).
  5. 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!
  • 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

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.

  • C99 standard library
  • Type traits
  • Unordered containers
  • array
  • tuple
  • shared_ptr and weak_ptr
  • Regular expression library
  • function, referenc_wrapper, etc.
  • Random number generation N2111
  • Thread support library N2497
  • exception_ptr etc. N2179
  • enable_if, conditional N2240
  • error_code etc. N2241
  • decay and relative changes N2244
  • next, prev, is_sort(_until), is_heap(_until) N2246
  • unique_ptr N1856
  • move_iterator N1859
  • move and moving algorithms N1860
  • Container's operation with move/forward
  • rvalue reference parameters N1858
  • emplace/emplace_back N2345
  • etc.
  • Requirements for stateful allocators N2525
  • forward_list N2543
  • scoped_allocator_adaptor and allocator-aware constructors N2554
  • Date and time library N2661(?)
  • etc.