Added lexical_cast(const CharType* chars, std::size_t count) function overload (refs #6430 and refs #6663)

Fixed GCC warning in numeric_cast_test.cpp

[SVN r80291]
This commit is contained in:
Antony Polukhin committed 2012-08-28 20:31:16 +00:00
1 parent 63acf4f174
commit d08477900d
4 files changed
+46 -2

No files matched your search

+11
View File
@@ -2300,6 +2300,17 @@ namespace boost {
return caster_type::lexical_cast_impl(arg);
}
template <typename Target, typename CharType>
inline Target lexical_cast(const CharType* chars, std::size_t count)
{
BOOST_STATIC_ASSERT_MSG(::boost::detail::is_char_or_wchar<CharType>::value,
"CharType must be a character or wide character type");
return ::boost::lexical_cast<Target>(
::boost::iterator_range<const CharType*>(chars, chars + count)
);
}
} // namespace boost
#else // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION