From ab699e251f471a9948457e4f93c594ed2e658ed9 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Fri, 10 Apr 2020 16:12:18 -0400 Subject: [PATCH] Take all primitive aspect_type by value --- include/boost/io/ios_state.hpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/include/boost/io/ios_state.hpp b/include/boost/io/ios_state.hpp index 10bfd73..632a122 100644 --- a/include/boost/io/ios_state.hpp +++ b/include/boost/io/ios_state.hpp @@ -7,8 +7,8 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_IO_IOS_STATE_HPP #define BOOST_IO_IOS_STATE_HPP +#include #include -#include #include #ifndef BOOST_NO_STD_LOCALE #include @@ -29,7 +29,7 @@ public: : s_save_(s) , a_save_(s.flags()) { } - ios_flags_saver(state_type& s, const aspect_type& a) + ios_flags_saver(state_type& s, aspect_type a) : s_save_(s) , a_save_(s.flags(a)) { } @@ -58,7 +58,7 @@ public: : s_save_(s) , a_save_(s.precision()) { } - ios_precision_saver(state_type& s, const aspect_type& a) + ios_precision_saver(state_type& s, aspect_type a) : s_save_(s) , a_save_(s.precision(a)) { } @@ -87,7 +87,7 @@ public: : s_save_(s) , a_save_(s.width()) { } - ios_width_saver(state_type& s, const aspect_type& a) + ios_width_saver(state_type& s, aspect_type a) : s_save_(s) , a_save_(s.width(a)) { } @@ -117,7 +117,7 @@ public: : s_save_(s) , a_save_(s.rdstate()) { } - basic_ios_iostate_saver(state_type& s, const aspect_type& a) + basic_ios_iostate_saver(state_type& s, aspect_type a) : s_save_(s) , a_save_(s.rdstate()) { s.clear(a); @@ -149,11 +149,7 @@ public: : s_save_(s) , a_save_(s.exceptions()) { } -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) basic_ios_exception_saver(state_type& s, aspect_type a) -#else - basic_ios_exception_saver(state_type& s, const aspect_type& a) -#endif : s_save_(s) , a_save_(s.exceptions()) { s.exceptions(a); @@ -185,7 +181,7 @@ public: : s_save_(s) , a_save_(s.tie()) { } - basic_ios_tie_saver(state_type& s, const aspect_type& a) + basic_ios_tie_saver(state_type& s, aspect_type a) : s_save_(s) , a_save_(s.tie(a)) { } @@ -215,7 +211,7 @@ public: : s_save_(s) , a_save_(s.rdbuf()) { } - basic_ios_rdbuf_saver(state_type& s, const aspect_type& a) + basic_ios_rdbuf_saver(state_type& s, aspect_type a) : s_save_(s) , a_save_(s.rdbuf(a)) { } @@ -245,7 +241,7 @@ public: : s_save_(s) , a_save_(s.fill()) { } - basic_ios_fill_saver(state_type& s, const aspect_type& a) + basic_ios_fill_saver(state_type& s, aspect_type a) : s_save_(s) , a_save_(s.fill(a)) { } @@ -308,7 +304,7 @@ public: , a_save_(s.iword(i)) , i_save_(i) { } - ios_iword_saver(state_type& s, index_type i, const aspect_type& a) + ios_iword_saver(state_type& s, index_type i, aspect_type a) : s_save_(s) , a_save_(s.iword(i)) , i_save_(i) { @@ -343,7 +339,7 @@ public: , a_save_(s.pword(i)) , i_save_(i) { } - ios_pword_saver(state_type& s, index_type i, const aspect_type& a) + ios_pword_saver(state_type& s, index_type i, aspect_type a) : s_save_(s) , a_save_(s.pword(i)) , i_save_(i) {