implicit.cpp 646 B

1234567891011121314151617181920212223
  1. // Copyright 2018 James E. King III. Use, modification and
  2. // distribution is subject to the Boost Software License, Version
  3. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #include <boost/logic/tribool.hpp>
  6. int main(int, char*[])
  7. {
  8. using boost::logic::indeterminate;
  9. using boost::logic::tribool;
  10. tribool i(indeterminate);
  11. #if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS )
  12. bool b = i; // expect to see: no viable conversion from 'boost::logic::tribool' to 'bool'
  13. return (int)b;
  14. #else
  15. #error in c++03 explicit conversions are allowed
  16. #endif
  17. // NOTREACHED
  18. return 0;
  19. }