Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2005-10-25 07:52:28

Bugs item #1337412, was opened at 2005-10-25 05:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: serialization
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Robert Ramey (ramey)
Summary: Compiler warning with gcc on Linux

Initial Comment:
I get the following warning compiling on Linux with
gcc. No mater what I do I can't seem to get around the
warning. Any ideas? Thanks!

g++ -c -pipe -Wall -W -g -fPIC
-I/usr/lib/qt-3.1/mkspecs/default -I. -I. -Iinclude
-Isrc -I../ccbus -I/usr/lib/qt-3.1/include -I.ui/
-I.moc/ -o .obj/TraderButtonKey.o src/TraderButtonKey.cpp
In member function `void
[with Archive =
instantiated from
unsigned int) [with Archive =
instantiated from here
warning: choosing `
   boost::archive::version_type::operator unsigned
int&()' over `
   boost::archive::version_type::operator unsigned
int() const'
warning: for
   conversion from `boost::archive::version_type' to
`unsigned int'
warning: because
   conversion sequence for the argument is better

Code fragment:

class TraderButtonKey

    //! Default constructor.

    TraderButtonKey( ) : m_cls(0), m_number(0) {}

    //! Constructor.
    //! \param cls the class
    //! \param number the number

    TraderButtonKey( int cls, int number ) :
m_cls(cls), m_number(number) {}



    //! Required by the boost C++ libraries to provide
serialization to
    //! and from the archive.
    //! \param ar archive to
save/load object members
    //! \param version boost class version

    template<class Archive> void serialize( Archive &
ar, const unsigned int version )

        if (version) // gets rid of unused parameter

        ar & m_cls;
        ar & m_number;

    int m_cls; //!< class of
the key
    int m_number; //!< number
within that class


You can respond by visiting:

This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit for more information
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at