Skip to content

Instantly share code, notes, and snippets.

@sylvainma
Created April 19, 2016 20:11
Show Gist options
  • Save sylvainma/a78337a742c8f1f387614a8f15e73396 to your computer and use it in GitHub Desktop.
Save sylvainma/a78337a742c8f1f387614a8f15e73396 to your computer and use it in GitHub Desktop.
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