function_test_fail2.cpp 467 B

123456789101112131415161718
  1. // Boost.Function library
  2. // Copyright (C) Douglas Gregor 2001-2005. Use, modification and
  3. // distribution is subject to the Boost Software License, Version
  4. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. // For more information, see http://www.boost.org
  7. #include <boost/function.hpp>
  8. static int bad_fn(float f) { return static_cast<int>(f); }
  9. void test()
  10. {
  11. boost::function0<int> f1;
  12. f1 = bad_fn;
  13. }