[freestanding.item] (original) (raw)

16 Library introduction [library]

16.3 Method of description [description]

16.3.3 Other conventions [conventions]

16.3.3.7 Freestanding items [freestanding.item]

A freestanding item is a declaration, entity, typedef-name, or macro that is required to be present in a freestanding implementation and a hosted implementation.

Unless otherwise specified, the requirements on freestanding items for a freestanding implementation are the same as the corresponding requirements for a hosted implementation, except that not all of the members of those items are required to be present.

Function declarations and function template declarations followed by a comment that include freestanding-deleted arefreestanding deleted functions.

On freestanding implementations, it is implementation-defined whether each entity introduced by a freestanding deleted function is a deleted function ([dcl.fct.def.delete]) or whether the requirements are the same as the corresponding requirements for a hosted implementation.

[Note 1:

Deleted definitions reduce the chance of overload resolution silently changing when migrating from a freestanding implementation to a hosted implementation.

— _end note_]

[Example 1: double abs(double j); — _end example_]

A declaration in a synopsis is a freestanding item if

[Example 2: namespace std { — _end example_]

An entity, deduction guide, or typedef-nameis a freestanding item if its introducing declaration is not followed by a comment that includes hosted, and is:

A macro is a freestanding item if it is defined in a header synopsis and

[Example 3: #define NULL see below — _end example_]

[Note 3:

Freestanding annotations follow some additional exposition conventions that do not impose any additional normative requirements.

Header synopses that begin with a comment containing "all freestanding" contain no hosted items and no freestanding deleted functions.

Header synopses that begin with a comment containing "mostly freestanding" contain at least one hosted item or freestanding deleted function.

Classes and class templates followed by a comment containing "partially freestanding" contain at least one hosted item or freestanding deleted function.

— _end note_]

[Example 4: template<class T, size_t N> struct array; template<class T, size_t N> struct array { constexpr reference operator[](size_type n);constexpr const_reference operator[](size_type n) const;constexpr reference at(size_type n); constexpr const_reference at(size_type n) const; }; — _end example_]