Compare commits

..

4 Commits

Author SHA1 Message Date
Beman Dawes 61678b0119 Release 1.40.0
[SVN r55802]
2009-08-27 16:24:59 +00:00
Troy D. Straszheim a3e690da32 Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +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
3 changed files with 64 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
#
# 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
)
+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;
}
+20
View File
@@ -0,0 +1,20 @@
#
# 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
)