Files
conversion/test/implicit_cast_fail.cpp
Antony Polukhin 7e484c17f6 Merge lexical_cast and some conversion docs and test from trunk:
* fixed int128 and uint128 conversions (fixes #8790)
* fixed warnings from Boost Inspection Report

[SVN r85160]
2013-07-25 16:29:11 +00:00

27 lines
655 B
C++

// Copyright David Abrahams 2003.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/implicit_cast.hpp>
#include <boost/type.hpp>
#define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp>
using boost::implicit_cast;
struct foo
{
explicit foo(char const*) {}
};
int test_main(int, char*[])
{
foo x = implicit_cast<foo>("foobar");
(void)x; // warning suppression.
BOOST_CHECK(false); // suppressing warning about 'boost::unit_test::{anonymous}::unit_test_log' defined but not used
return 0;
}