Compare commits

...

3 Commits

Author SHA1 Message Date
Beman Dawes 4b329313d1 Release 1.37.0
[SVN r51178]
2009-02-10 13:14:42 +00:00
Troy D. Straszheim fb681bb0ea merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
Alexander Nasonov 98a67d93f3 Fixes #1220: lexical_cast requires RTTI
[SVN r50124]
2008-12-04 23:18:50 +00:00
4 changed files with 52 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
#----------------------------------------------------------------------------
# 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
)
Executable → Regular
View File
+16 -1
View File
@@ -60,15 +60,21 @@ namespace boost
{
public:
bad_lexical_cast() :
source(&typeid(void)), target(&typeid(void))
#ifndef BOOST_NO_TYPEID
source(&typeid(void)), target(&typeid(void))
#else
source(0), target(0) // this breaks getters
#endif
{
}
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;
@@ -77,6 +83,7 @@ namespace boost
{
return *target;
}
virtual const char *what() const throw()
{
return "bad lexical cast: "
@@ -1144,7 +1151,11 @@ 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)
}
}
@@ -1183,7 +1194,11 @@ 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;
}
+14
View File
@@ -0,0 +1,14 @@
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
)