boost_no_lambdas.ipp 763 B

123456789101112131415161718192021222324252627282930
  1. // (C) Copyright Beman Dawes 2009
  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 more information.
  6. // MACRO: BOOST_NO_CXX11_LAMBDAS
  7. // TITLE: C++0x lambda feature unavailable
  8. // DESCRIPTION: The compiler does not support the C++0x lambda feature
  9. #if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(BOOST_INTEL_STDCXX0X)
  10. # error This feature is not available in non-C++0x mode
  11. #endif
  12. namespace boost_no_cxx11_lambdas {
  13. template <class Func>
  14. int f(Func f)
  15. {
  16. return f();
  17. }
  18. int test()
  19. {
  20. return f([](){ return 0; });
  21. }
  22. }