|
Boost : |
From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2006-01-09 11:33:07
While using the boost::rational MSVC7.1 generates errors saying:
warning C4512: 'boost::detail::resetter' : assignment operator could not
be generated
So I propose following diff to boost::detail::resetter that makes this
warning go away
RCS file: /cvsroot/boost/boost/boost/rational.hpp,v
retrieving revision 1.16
diff -u -r1.16 rational.hpp
--- rational.hpp 27 Dec 2005 11:38:27 -0000 1.16
+++ rational.hpp 9 Jan 2006 16:32:12 -0000
@@ -462,11 +462,16 @@
// A utility class to reset the format flags for an istream at end
// of scope, even in case of exceptions
- struct resetter {
+ class resetter {
+ public:
resetter(std::istream& is) : is_(is), f_(is.flags()) {}
~resetter() { is_.flags(f_); }
std::istream& is_;
std::istream::fmtflags f_; // old GNU c++ lib has no ios_base
+ private:
+ // MSVC 7.1 complains that he is unable to generate the assignment-
+ // operator so we generate it for him as to avoid the warning.
+ resetter& operator=(const resetter&) ;
};
}
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk