A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4140/dcl.type.simple below:

[dcl.type.simple]

7.1.6.2 Simple type specifiers [dcl.type.simple]

The auto specifier is a placeholder for a type to be deduced ([dcl.spec.auto]). The other simple-type-specifiers specify either a previously-declared type, a type determined from an expression, or one of the fundamental types ([basic.fundamental]). Table [tab:simple.type.specifiers] summarizes the valid combinations of simple-type-specifiers and the types they specify.

Table

10

simple-type-specifiers

and the types they specify


Specifier(s) Type type-name the type named simple-template-id the type as defined in [temp.names] char “char” unsigned char “unsigned char” signed char “signed char” char16_t “char16_t” char32_t “char32_t” bool “bool” unsigned “unsigned int” unsigned int “unsigned int” signed “int” signed int “int” int “int” unsigned short int “unsigned short int” unsigned short “unsigned short int” unsigned long int “unsigned long int” unsigned long “unsigned long int” unsigned long long int “unsigned long long int” unsigned long long “unsigned long long int” signed long int “long int” signed long “long int” signed long long int “long long int” signed long long “long long int” long long int “long long int” long long “long long int” long int “long int” long “long int” signed short int “short int” signed short “short int” short int “short int” short “short int” wchar_t “wchar_t” float “float” double “double” long double “long double” void “void” auto placeholder for a type to be deduced decltype(expression) the type as defined below

When multiple simple-type-specifiers are allowed, they can be freely intermixed with other decl-specifiers in any order. [ Note: It is implementation-defined whether objects of char type are represented as signed or unsigned quantities. The signed specifier forces char objects to be signed; it is redundant in other contexts.  — end note ]

For an expression e, the type denoted by decltype(e) is defined as follows:

The operand of the decltype specifier is an unevaluated operand (Clause [expr]).

Example:

const int&& foo();
int i;
struct A { double x; };
const A* a = new A();
decltype(foo()) x1 = 0;         decltype(i) x2;                 decltype(a->x) x3;              decltype((a->x)) x4 = x3;       

 — end example ] [ Note: The rules for determining types involving decltype(auto) are specified in [dcl.spec.auto].  — end note ]

Note: in the case where the operand of a decltype-specifier is a function call and the return type of the function is a class type, a special rule ([expr.call]) ensures that the return type is not required to be complete (as it would be if the call appeared in a sub-expression or outside of a decltype-specifier). In this context, the common purpose of writing the expression is merely to refer to its type. In that sense, a decltype-specifier is analogous to a use of a typedef-name, so the usual reasons for requiring a complete type do not apply. In particular, it is not necessary to allocate storage for a temporary object or to enforce the semantic constraints associated with invoking the type's destructor. [ Example:

template<class T> struct A { ~A() = delete; };
template<class T> auto h()
  -> A<T>;
template<class T> auto i(T)       -> T;
template<class T> auto f(T)       -> decltype(i(h<T>()));                                                                                                       template<class T> auto f(T)       -> void;
auto g() -> void {
  f(42);                                                                                        }
template<class T> auto q(T)
  -> decltype((h<T>()));                                        void r() {
  q(42);                                                                                                                        }

 — end example ] — end note ]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4