You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test-rvalue-ref.cpp 301B

1234567891011121314151617181920212223
  1. #include "type_name.h"
  2. #include <iostream>
  3. void f(const int&) {
  4. }
  5. #define T(v) std::cout << #v << ": " << TYPE_NAME(v) << "\n"
  6. int main() {
  7. auto&& i = 1;
  8. auto& ri = i;
  9. auto const& x = std::move(ri);
  10. decltype(ri) y = ri;
  11. f(i);
  12. // f(std::forward(i));
  13. T(i);
  14. T(ri);
  15. T(x);
  16. T(y);
  17. return 0;
  18. }