boost_has_rvalue_refs.ipp 639 B

1234567891011121314151617181920212223242526
  1. // Copyright (C) 2007 Douglas Gregor
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_HAS_RVALUE_REFS
  7. // TITLE: rvalue references
  8. // DESCRIPTION: The compiler supports C++0x rvalue references
  9. namespace boost_has_rvalue_refs {
  10. void g(int&) {}
  11. template<typename F, typename T>
  12. void forward(F f, T&& t) { f(static_cast<T&&>(t)); }
  13. int test()
  14. {
  15. int x;
  16. forward(g, x);
  17. return 0;
  18. }
  19. }