Boost logo

Boost :

From: Vadim Zeitlin (vz-boost_at_[hidden])
Date: 2005-08-17 05:41:01


 Hello,

 when compiling <boost/algorithm/string/trim.hpp> with MSVC 7.1 at maximal
warning level you get a warning 4512 ("assignment operator could not be
generated") because of the const members in struct is_classifiedF from
boost/algorithm/string/detail/classification.hpp.

 The trivial patch below fixes it. Notice that I didn't take the assignment
operator in "#ifdef _MSC_VER" because I see no harm in doing this for all
compilers but then no other compiler I know about gives such warning so it
should be also safe to add the #ifdef if this is preferred.

*** classification.hpp.orig Wed Aug 17 10:19:50 2005
--- classification.hpp Wed Aug 17 10:19:46 2005
***************
*** 55,60 ****
--- 55,64 ----
                  #endif
  
              private:
+ // prevent compiler from trying to generate this operator
+ // automatically (and failing because of const members)
+ is_classifiedF& operator=(const is_classifiedF&);
+
                  const std::ctype_base::mask m_Type;
                  const std::locale m_Locale;
              };

 Thanks in advance,
VZ


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk