39710 {
39711 typedef ::std::basic_ostream<char_T,traits> stream_t;
39712 typedef stream_t::traits_type traits_t;
39713 typename stream_t::iostate state = stream_t::goodbit;
39714
39715 size_t size = str.
size();
39717 size_t pad;
39718 if(os.width() <= 0 || static_cast<size_t>(os.width()) <= size)
39719 pad = 0;
39720 else
39721 pad = static_cast<size_t>(os.width()) - size;
39723
39724 const typename stream_t::sentry isok(os);
39725
39726 if(!isok)
39727 state |= stream_t::badbit;
39728 else{
39729 try{
39730 if((os.flags() & stream_t::adjustfield) != stream_t::left){
39731 for(; 0 < pad; --pad){
39732 if(traits_t::eq_int_type(traits_t::eof(), os.rdbuf()->sputc(os.fill()))){
39733 state |= stream_t::badbit;
39734 break;
39735 }
39736 }
39737 }
39738 if(state == stream_t::goodbit){
39739 stream_n::std_ostream_wrap wrap(os);
39740 wrap<<str;
39741 }
39742 if(os.fail())
39743 state |= stream_t::badbit;
39744 else{
39745 for(; 0 < pad; --pad){
39746 if(traits_t::eq_int_type(traits_t::eof(), os.rdbuf()->sputc(os.fill()))){
39747 state |= stream_t::badbit;
39748 break;
39749 }
39750 }
39751 }
39752 os.width(0);
39753 }
39754 catch(...){
39755 os.setstate(stream_t::badbit, true);
39756 return os;
39757 }
39758 }
39759 os.setstate(state);
39760 return os;
39761 }
#define pop_msvc_warning()
#define push_and_disable_msvc_warning(...)
size_t size() const noexcept