mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
More modifications according to the review.
[SVN r84611]
This commit is contained in:
parent
f3bb2a493c
commit
d09b37d3ef
@ -406,11 +406,11 @@ namespace boost {
|
|||||||
|
|
||||||
template<class charT, class traits>
|
template<class charT, class traits>
|
||||||
inline void insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
|
inline void insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
|
||||||
charT fill_chars[8];
|
enum { chunk_size = 8 };
|
||||||
std::fill_n(fill_chars, 8, os.fill());
|
charT fill_chars[chunk_size];
|
||||||
for (std::size_t m = n / 8u; m > 0 && os.good(); --m)
|
std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
|
||||||
os.write(fill_chars, 8);
|
for (; n >= chunk_size && os.good(); n -= chunk_size)
|
||||||
n &= 7u;
|
os.write(fill_chars, static_cast< std::streamsize >(chunk_size));
|
||||||
if (n > 0 && os.good())
|
if (n > 0 && os.good())
|
||||||
os.write(fill_chars, static_cast< std::streamsize >(n));
|
os.write(fill_chars, static_cast< std::streamsize >(n));
|
||||||
}
|
}
|
||||||
@ -427,7 +427,8 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
os.write(str.data(), static_cast< std::streamsize >(size));
|
os.write(str.data(), static_cast< std::streamsize >(size));
|
||||||
detail::insert_fill_chars(os, alignment_size);
|
if (os.good())
|
||||||
|
detail::insert_fill_chars(os, alignment_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user