mirror of
https://github.com/boostorg/conversion.git
synced 2026-08-06 13:34:14 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f5f44c3c6c |
@@ -1,28 +0,0 @@
|
||||
#
|
||||
# Copyright Troy D. Straszheim
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See http://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
# This file was automatically generated from the original CMakeLists.txt file
|
||||
# Add a variable to hold the headers for the library
|
||||
set (lib_headers
|
||||
|
||||
)
|
||||
|
||||
# Add a library target to the build system
|
||||
boost_library_project(
|
||||
conversion
|
||||
# SRCDIRS
|
||||
TESTDIRS test
|
||||
# HEADERS ${lib_headers}
|
||||
# DOCDIRS
|
||||
DESCRIPTION "Polymorphic and lexical casts"
|
||||
# MODULARIZED
|
||||
AUTHORS "David Abrahams <dave -at- boost-consulting.com>"
|
||||
"Kevlin Henney"
|
||||
# MAINTAINERS
|
||||
)
|
||||
|
||||
|
||||
@@ -60,21 +60,15 @@ namespace boost
|
||||
{
|
||||
public:
|
||||
bad_lexical_cast() :
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
source(&typeid(void)), target(&typeid(void))
|
||||
#else
|
||||
source(0), target(0) // this breaks getters
|
||||
#endif
|
||||
source(&typeid(void)), target(&typeid(void))
|
||||
{
|
||||
}
|
||||
|
||||
bad_lexical_cast(
|
||||
const std::type_info &source_type_arg,
|
||||
const std::type_info &target_type_arg) :
|
||||
source(&source_type_arg), target(&target_type_arg)
|
||||
{
|
||||
}
|
||||
|
||||
const std::type_info &source_type() const
|
||||
{
|
||||
return *source;
|
||||
@@ -83,7 +77,6 @@ namespace boost
|
||||
{
|
||||
return *target;
|
||||
}
|
||||
|
||||
virtual const char *what() const throw()
|
||||
{
|
||||
return "bad lexical cast: "
|
||||
@@ -1151,11 +1144,7 @@ namespace boost
|
||||
if (interpreter >> result)
|
||||
return result;
|
||||
}
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
|
||||
#else
|
||||
throw_exception(bad_lexical_cast());
|
||||
#endif
|
||||
return Target(); // normally never reached (throw_exception)
|
||||
}
|
||||
}
|
||||
@@ -1194,11 +1183,7 @@ namespace boost
|
||||
Target result;
|
||||
|
||||
if(!(interpreter << arg && interpreter >> result))
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
|
||||
#else
|
||||
throw_exception(bad_lexical_cast());
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#
|
||||
# Copyright Troy D. Straszheim
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See http://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
boost_additional_test_dependencies(conversion BOOST_DEPENDS test detail numeric)
|
||||
|
||||
boost_test_run(implicit_cast)
|
||||
boost_test_compile_fail(implicit_cast_fail)
|
||||
boost_test_run(cast_test ../cast_test.cpp)
|
||||
boost_test_run(numeric_cast_test ../numeric_cast_test.cpp)
|
||||
boost_test_run(
|
||||
lexical_cast_test
|
||||
../lexical_cast_test.cpp
|
||||
DEPENDS boost_unit_test_framework
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user