optional_test_maybe_uninitialized_warning.cpp 661 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2017 Andrzej Krzemienski.
  2. //
  3. // Use, modification, and distribution is subject to the Boost Software
  4. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/lib/optional for documentation.
  8. //
  9. // You are welcome to contact the author at:
  10. // akrzemi1@gmail.com
  11. #include "boost/optional/optional.hpp"
  12. #ifdef __BORLANDC__
  13. #pragma hdrstop
  14. #endif
  15. boost::optional<int> getitem();
  16. int main(int argc, const char *[])
  17. {
  18. boost::optional<int> a = getitem();
  19. boost::optional<int> b;
  20. if (argc > 0)
  21. b = argc;
  22. if (a == b)
  23. return 1;
  24. return 0;
  25. }