lexical_cast/test/implicit_cast_fail.cpp
John Maddock fce9ad4e1b Misc small fixes to suppress warnings.
Code should now be clean with msvc /W4 and gcc /Wall /Wextra -pedantic with the exception of one deliberate warning in one test.

[SVN r57510]
2009-11-09 12:27:54 +00:00

25 lines
523 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.
return 0;
}