diff --git a/include/armadillo_bits/BaseCube_meat.hpp b/include/armadillo_bits/BaseCube_meat.hpp index 60716c76..eef783b1 100644 --- a/include/armadillo_bits/BaseCube_meat.hpp +++ b/include/armadillo_bits/BaseCube_meat.hpp @@ -41,7 +41,11 @@ BaseCube::print(const std::string extra_text) const if(extra_text.length() != 0) { + const std::streamsize orig_width = get_cout_stream().width(); + get_cout_stream() << extra_text << '\n'; + + get_cout_stream().width(orig_width); } arma_ostream::print(get_cout_stream(), tmp.M, true); @@ -61,7 +65,11 @@ BaseCube::print(std::ostream& user_stream, const std::string if(extra_text.length() != 0) { + const std::streamsize orig_width = user_stream.width(); + user_stream << extra_text << '\n'; + + user_stream.width(orig_width); } arma_ostream::print(user_stream, tmp.M, true); @@ -81,7 +89,11 @@ BaseCube::raw_print(const std::string extra_text) const if(extra_text.length() != 0) { + const std::streamsize orig_width = get_cout_stream().width(); + get_cout_stream() << extra_text << '\n'; + + get_cout_stream().width(orig_width); } arma_ostream::print(get_cout_stream(), tmp.M, false); @@ -101,7 +113,11 @@ BaseCube::raw_print(std::ostream& user_stream, const std::str if(extra_text.length() != 0) { + const std::streamsize orig_width = user_stream.width(); + user_stream << extra_text << '\n'; + + user_stream.width(orig_width); } arma_ostream::print(user_stream, tmp.M, false);