forked from boostorg/system
Add negative test for constructing result<int> from errc_t (refs #74)
This commit is contained in:
@ -154,3 +154,4 @@ run result_eq.cpp : : : $(CPP11) ;
|
||||
run result_range_for.cpp : : : $(CPP11) ;
|
||||
run result_value_construct2.cpp : : : $(CPP11) ;
|
||||
run result_error_construct2.cpp : : : $(CPP11) ;
|
||||
run result_errc_construct.cpp : : : $(CPP11) ;
|
||||
|
23
test/result_errc_construct.cpp
Normal file
23
test/result_errc_construct.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright 2021 Peter Dimov.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/system/result.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace boost::system;
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_FALSE((std::is_convertible<errc::errc_t, result<int>>));
|
||||
BOOST_TEST_TRAIT_FALSE((std::is_constructible<result<int>, errc::errc_t>));
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((std::is_convertible<errc::errc_t, result<double>>));
|
||||
BOOST_TEST_TRAIT_FALSE((std::is_constructible<result<double>, errc::errc_t>));
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((std::is_convertible<errc::errc_t, result<bool>>));
|
||||
BOOST_TEST_TRAIT_FALSE((std::is_constructible<result<bool>, errc::errc_t>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user