Re: [Boost-bugs] [Boost C++ Libraries] #6068: Serialization doesn't work with strongly typed enum

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6068: Serialization doesn't work with strongly typed enum
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-13 10:51:07


#6068: Serialization doesn't work with strongly typed enum
-------------------------------------------------------+--------------------
  Reporter: Tommi Tissari <tommitissari@…> | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.47.0 | Severity: Problem
Resolution: invalid | Keywords: serialization enum
-------------------------------------------------------+--------------------

Comment (by tommitissari@…):

 Replying to [comment:1 ramey]:
> I don't know what you mean by a "strongly typed enum". If you want to
 post a small sample I'll have a look at it. But until that happens
 there's nothing I can do.
>
> Robert Ramey
 ----
 I mean the new C++11 strongly typed enumeration as described here:[[br]]
 http://en.wikipedia.org/wiki/C%2B%2B11#Strongly_typed_enumerations

 Compiling the following gives the error:[[br]]
 C:\Boost\include\boost-1_47\boost/serialization/access.hpp(118): error :
 expression must have class type

 {{{
 enum class MyEnum { first, second, third };
 MyEnum myenum = MyEnum::second;

 std::ofstream file( _T("serialized_enum"), std::ios::out |
 std::ios::binary );
 boost::archive::binary_oarchive outArchive( file );

 outArchive << myenum;
 file.close();
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6068#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC