Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well currently I only work with C not C++ anymore so my knowledge might be outdated. I thought that the rvalue reference is something new in C++11, as I read it here: http://thbecker.net/articles/rvalue_references/section_01.ht.... Your article seems to mention different thing from 2008? In the article I read, a function returns a pointer that you can assign it like this: get_pointer() = 1;


The design of C++11 started way before 2011, hence articles from 2008.

  get_pointer() = 1;
assigning 1 to a pointer isn't the best idea :P so I think you mean you read

  int& get_reference();
  get_reference() = 1;
which is about lvalue references, not rvalue references, and has existed in C++ since the beginning.


Thanks for the explanation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: