Collection of DPF-based plugins for packaging
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.

51 lines
1.6KB

  1. # =============================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_rvalue_references.html
  3. # =============================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_RVALUE_REFERENCES
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check whether C++11 rvalue references are supported. If they are, the
  12. # macro HAVE_RVALUE_REFERENCES is defined.
  13. #
  14. # Does not ensure that the compiler is in C++11 mode.
  15. #
  16. # LICENSE
  17. #
  18. # Copyright (c) 2012 Tudor Bosman <tudorb@gmail.com>
  19. #
  20. # Copying and distribution of this file, with or without modification, are
  21. # permitted in any medium without royalty provided the copyright notice
  22. # and this notice are preserved. This file is offered as-is, without any
  23. # warranty.
  24. #serial 2
  25. AC_DEFUN([AX_CXX_RVALUE_REFERENCES], [dnl
  26. AC_LANG_ASSERT([C++])
  27. # This compilation should succeed...
  28. AC_CACHE_CHECK(whether $CXX supports rvalue references,
  29. ax_cv_cxx_rvalue_references_supported, [
  30. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  31. #include <utility>
  32. struct foo {
  33. foo(foo&& other) { }
  34. foo& operator=(foo&& other) {
  35. if (&other == this) return *this;
  36. std::move(other); // make sure this compiles
  37. return *this;
  38. }
  39. };
  40. ]])],
  41. [ax_cv_cxx_rvalue_references_supported=yes],
  42. [ax_cv_cxx_rvalue_references_supported=no])])
  43. if test $ax_cv_cxx_rvalue_references_supported = yes
  44. then
  45. AC_DEFINE([HAVE_RVALUE_REFERENCES], [],
  46. [define if the compiler supports rvalue references])
  47. fi
  48. ])