Guest User

Untitled

a guest
Jun 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // Convenience to make things more legible in the following code
  2. const float & x = some.buried.variable.elsewhere;
  3.  
  4. // Go on to use x in calculations...
  5.  
  6. assert(&x == &some.buried.variable.elsewhere)
  7.  
  8. const float x = some.buried.variable.elsewhere;
  9.  
  10. float &x = some.buried.variable.elsewhere;
  11.  
  12. float const &x = 3.0; // non-sense. don't use reference here
  13.  
  14. float const &x = get_some_float(); // non-sense too.
  15.  
  16. const T& x = some.buried.variable.elsewhere;
Add Comment
Please, Sign In to add comment