Created
April 19, 2016 20:11
-
-
Save sylvainma/a78337a742c8f1f387614a8f15e73396 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const T& A::méthode() { | |
T t; | |
return t; | |
} | |
int main() { | |
A a; | |
T h = a.méthode(); // On récupère la référence const | |
h.getValue(); // On suppose que le type T a une méthode getValue(), | |
// erreur ou pas ? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment