Matching overloaded functions

Nasza ocena:

3
Wyświetleń: 679
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Matching overloaded functions - strona 1 Matching overloaded functions - strona 2

Fragment notatki:

Matching overloaded functions  no more than one conversion per argument  pick lowest match level, ambiguity is an error 1. exact match (no conversion, but table to pointer, function to pointer, T to const T) 2. promotions (int to long, char to int, unsigned to long unsigned, float to double, etc.) 3. standard conversions (unsigned int ↔ int, int ↔ double, derived * to base *) 4. user defined conversions 5. variable argument list (…) int f(int); double f(double) void f(); int j=f(1); // OK int k=f(1.0); // OK, call double f(double), // then convert result to int //int n=f(”Abc”); ERROR! no standard conversion // char * to int or double ... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz