mirror of
https://github.com/boostorg/lexical_cast.git
synced 2025-05-09 23:03:55 +00:00
Do not use variable names ending on underscore for input variables and simpler warning suppression for generic_stringize example
This commit is contained in:
parent
a0b5e8415d
commit
398b451036
@ -55,7 +55,7 @@ int main() {
|
||||
boost::tuple<char, int, char, int> decim('-', 10, 'e', 5);
|
||||
assert(stringize(decim) == "-10e5");
|
||||
|
||||
std::pair<short, std::string> value_and_type(270, "Kelvin");
|
||||
std::pair<int, std::string> value_and_type(270, "Kelvin");
|
||||
assert(stringize(value_and_type) == "270Kelvin");
|
||||
}
|
||||
|
||||
|
@ -200,18 +200,18 @@ namespace boost {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool shl_char_array(CharT const* str_) BOOST_NOEXCEPT {
|
||||
start = str_;
|
||||
finish = start + Traits::length(str_);
|
||||
bool shl_char_array(CharT const* str_value) BOOST_NOEXCEPT {
|
||||
start = str_value;
|
||||
finish = start + Traits::length(str_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool shl_char_array(T const* str_) {
|
||||
bool shl_char_array(T const* str_value) {
|
||||
BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)),
|
||||
"boost::lexical_cast does not support narrowing of char types."
|
||||
"Use boost::locale instead" );
|
||||
return shl_input_streamable(str_);
|
||||
return shl_input_streamable(str_value);
|
||||
}
|
||||
|
||||
bool shl_char_array_limited(CharT const* str, std::size_t max_size) BOOST_NOEXCEPT {
|
||||
@ -424,8 +424,8 @@ namespace boost {
|
||||
bool operator<<(unsigned char * ch) { return ((*this) << reinterpret_cast<char *>(ch)); }
|
||||
bool operator<<(signed char const* ch) { return ((*this) << reinterpret_cast<char const*>(ch)); }
|
||||
bool operator<<(signed char * ch) { return ((*this) << reinterpret_cast<char *>(ch)); }
|
||||
bool operator<<(char const* str_) { return shl_char_array(str_); }
|
||||
bool operator<<(char* str_) { return shl_char_array(str_); }
|
||||
bool operator<<(char const* str_value) { return shl_char_array(str_value); }
|
||||
bool operator<<(char* str_value) { return shl_char_array(str_value); }
|
||||
bool operator<<(short n) { return shl_signed(n); }
|
||||
bool operator<<(int n) { return shl_signed(n); }
|
||||
bool operator<<(long n) { return shl_signed(n); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user