Update of /cvsroot/boost/boost/boost/archive
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4233

Modified Files:
        basic_binary_oarchive.hpp 
Log Message:
const correctness

Index: basic_binary_oarchive.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/archive/basic_binary_oarchive.hpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- basic_binary_oarchive.hpp   22 Jun 2006 07:20:23 -0000      1.11
+++ basic_binary_oarchive.hpp   16 Jul 2007 16:19:05 -0000      1.12
@@ -43,9 +43,6 @@
 // by a program built with the same tools for the same machne.  This class
 // does have the virtue of buiding the smalles archive in the minimum amount
 // of time.  So under some circumstances it may be he right choice.
-
-/////////////////////////////////////////////////////////////////////////
-// class basic_text_iarchive - read serialized objects from a input text stream
 template<class Archive>
 class basic_binary_oarchive : 
     public array::oarchive<Archive>
@@ -63,31 +60,35 @@
     // any datatype not specifed below will be handled by base class
     typedef array::oarchive<Archive> array_oarchive;
     template<class T>
-    void save_override(T & t, BOOST_PFTO int){
+    void save_override(const T & t, BOOST_PFTO int){
         this->array_oarchive::save_override(t, 0);
     }
+    template<class T>
+    void save_override(T & t, BOOST_PFTO int){
+        this->save_override(const_cast<const T &>(t), 0);
+    }
     // binary files don't include the optional information 
     void save_override(const class_id_optional_type & /* t */, int){}
 
     void save_override(const version_type & t, int){
         // upto 255 versions
         // note:t.t resolves borland ambguity
-        unsigned  char x = t.t;
+        const unsigned char x = t.t;
         * this->This() << x;
     }
     void save_override(const class_id_type & t, int){
         // upto 32K classes
-        int_least16_t x = t.t;
+        const int_least16_t x = t.t;
         * this->This() << x;
     }
     void save_override(const class_id_reference_type & t, int){
         // upto 32K classes
-        int_least16_t x = t.t;
+        const int_least16_t x = t.t;
         * this->This() << x;
     }
     void save_override(const object_id_type & t, int){
         // upto 2G objects
-        uint_least32_t x = t.t;
+        const uint_least32_t x = t.t;
         * this->This() << x;
     }
     void save_override(const object_reference_type & t, int){
@@ -96,7 +97,7 @@
         * this->This() << x;
     }
     void save_override(const tracking_type & t, int){
-        char x = t.t;
+        const char x = t.t;
         * this->This() << x;
     }
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to