Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / serialization / example / portable_binary_iarchive.hpp
index 21f7097..e381df3 100644 (file)
@@ -2,7 +2,7 @@
 #define PORTABLE_BINARY_IARCHIVE_HPP
 
 // MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
 # pragma once
 #endif
 
@@ -27,7 +27,6 @@
 #include <boost/archive/archive_exception.hpp>
 #include <boost/archive/basic_binary_iprimitive.hpp>
 #include <boost/archive/detail/common_iarchive.hpp>
-#include <boost/archive/shared_ptr_helper.hpp>
 #include <boost/archive/detail/register_archive.hpp>
 
 #include "portable_binary_archive.hpp"
 // exception to be thrown if integer read from archive doesn't fit
 // variable being loaded
 class portable_binary_iarchive_exception : 
-    public virtual boost::archive::archive_exception
+    public boost::archive::archive_exception
 {
 public:
-    typedef enum {
-        incompatible_integer_size 
-    } exception_code;
+    enum exception_code {
+        incompatible_integer_size
+    } m_exception_code ;
     portable_binary_iarchive_exception(exception_code c = incompatible_integer_size ) :
-        boost::archive::archive_exception(boost::archive::archive_exception::other_exception)
+        boost::archive::archive_exception(boost::archive::archive_exception::other_exception),
+        m_exception_code(c)
     {}
     virtual const char *what( ) const throw( )
     {
         const char *msg = "programmer error";
-        switch(code){
+        switch(m_exception_code){
         case incompatible_integer_size:
             msg = "integer cannot be represented";
             break;
@@ -74,8 +74,6 @@ class portable_binary_iarchive :
     public boost::archive::detail::common_iarchive<
         portable_binary_iarchive
     >
-    ,
-    public boost::archive::detail::shared_ptr_helper
     {
     typedef boost::archive::basic_binary_iprimitive<
         portable_binary_iarchive,