add_classifiers_seq.cpp 732 B

1234567891011121314151617181920212223242526
  1. // Copyright (C) 2009-2012 Lorenzo Caminiti
  2. // Distributed under the Boost Software License, Version 1.0
  3. // (see accompanying file LICENSE_1_0.txt or a copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Home at http://www.boost.org/libs/local_function
  6. #include <boost/config.hpp>
  7. #ifndef BOOST_NO_CXX11_AUTO_DECLARATIONS
  8. # error "auto-declarations not allowed (using `auto` as storage classifier)"
  9. #else
  10. #include <boost/local_function.hpp>
  11. #include <boost/detail/lightweight_test.hpp>
  12. int main(void) {
  13. int BOOST_LOCAL_FUNCTION( (auto int x) (register int y) ) {
  14. return x + y;
  15. } BOOST_LOCAL_FUNCTION_NAME(add)
  16. BOOST_TEST(add(1, 2) == 3);
  17. return boost::report_errors();
  18. }
  19. #endif // AUTO_DECLARATIONS