[range] Fixed a bug in istream_range() that prevented it from working with character types other than 'char' (refs #7407).

[SVN r84707]
This commit is contained in:
Nathan Ridge
2013-06-09 02:34:36 +00:00
parent 8be23dd1aa
commit b0c1cf556f
2 changed files with 13 additions and 6 deletions

View File

@ -19,15 +19,15 @@
namespace
{
// Test an integer range with a step size of 1.
void test_istream_range()
template <typename CharT>
void test_istream_range_impl()
{
std::stringstream s;
std::basic_stringstream<CharT> s;
std::vector<int> reference;
for (int i = 0; i < 10; ++i)
{
reference.push_back(i);
s << i << " ";
s << i << CharT(' ');
}
std::vector<int> target;
@ -36,6 +36,13 @@ namespace
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
target.begin(), target.end() );
}
// Test an istream range.
void test_istream_range()
{
test_istream_range_impl<char>();
test_istream_range_impl<wchar_t>();
}
} // namespace anonymous namespace