cf_arith_func_ptr.cpp 460 B

1234567891011121314151617
  1. // Copyright (c) 2017 Andrey Semashev
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #include <boost/atomic.hpp>
  7. int main(int, char *[])
  8. {
  9. // The test verifies that atomic<> does not provide arithmetic operations on function pointers
  10. typedef void (*func_ptr)(int);
  11. boost::atomic< func_ptr > a;
  12. a.fetch_add(1);
  13. return 1;
  14. }