scoped_ptr_eq_fail.cpp 714 B

123456789101112131415161718192021222324252627
  1. #include <boost/config.hpp>
  2. #if defined(BOOST_MSVC)
  3. #pragma warning(disable: 4786) // identifier truncated in debug info
  4. #pragma warning(disable: 4710) // function not inlined
  5. #pragma warning(disable: 4711) // function selected for automatic inline expansion
  6. #pragma warning(disable: 4514) // unreferenced inline removed
  7. #endif
  8. //
  9. // scoped_ptr_eq_fail.cpp - a negative test for "p == q"
  10. //
  11. // Copyright (c) 2008 Peter Dimov
  12. //
  13. // Distributed under the Boost Software License, Version 1.0. (See
  14. // accompanying file LICENSE_1_0.txt or copy at
  15. // http://www.boost.org/LICENSE_1_0.txt)
  16. //
  17. #include <boost/scoped_ptr.hpp>
  18. int main()
  19. {
  20. boost::scoped_ptr<int> p, q;
  21. p == q; // must fail
  22. return 0;
  23. }