Categorization of argument to parameter cost

suggest change

Overload resolution partitions the cost of passing an argument to a parameter into one of four different categorizes, called “sequences”. Each sequence may include zero, one or several conversions

void f(int a); f(42);
void f(std::string s); f("hello");
void f(...); f(42);
void f(std::vector<int> v); f({1, 2, 3});

The general principle is that Standard conversion sequences are the cheapest, followed by user defined conversion sequences, followed by ellipsis conversion sequences.

A special case is the list initialization sequence, which does not constitute a conversion (an initializer list is not an expression with a type). Its cost is determined by defining it to be equivalent to one of the other three conversion sequences, depending on the parameter type and form of initializer list.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Overload resolution:
* Categorization of argument to parameter cost

Table Of Contents
8 Arrays
11 Loops
39 Streams
51 Unions
56 Lambdas
60 SFINAE
62 RAII
67 Sorting
72 Overload resolution
84 RTTI
87 Scopes
104 Profiling
107 Recursion
117 Iteration
125 Alignment
134 Semaphore
136 Debugging
139 Mutexes
142 decltype