[serialization] Any reason why std::complex is not supported?

It would be nice to just be able to #include <boost/serialization/ complex.hpp>, particularly for use in conjunction with Boost.MPI...any reason that header doesn't exist? Matthias

no one has done it. I woudn't think it would be too hard. Feel free to do this and add it to the vault. Robert Ramey Matthias Schabel wrote:
It would be nice to just be able to #include <boost/serialization/ complex.hpp>, particularly for use in conjunction with Boost.MPI...any reason that header doesn't exist?
Matthias _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On 13 Nov 2007, at 06:38, Robert Ramey wrote:
no one has done it. I woudn't think it would be too hard. Feel free to do this and add it to the vault.
Robert Ramey
Matthias Schabel wrote:
It would be nice to just be able to #include <boost/serialization/ complex.hpp>, particularly for use in conjunction with Boost.MPI...any reason that header doesn't exist?
Matthias _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Since we already support std::complex partially in Boost.MPI this indeed makes sense. It would take only a few minutes. Robert, is it OK with you if I add a serialization/complex.hpp header? Matthias

BTW, I posted this before: namespace boost { namespace serialization { template<class T> struct implementation_level<std::complex<T> > { typedef mpl::integral_c_tag tag; // typedef mpl::int_<primitive_type> type; typedef mpl::int_<object_serializable> type; BOOST_STATIC_CONSTANT( int, value = implementation_level::type::value ); }; template<class T> struct tracking_level<std::complex<T> > { typedef mpl::integral_c_tag tag; typedef mpl::int_<track_never> type; BOOST_STATIC_CONSTANT( int, value = tracking_level::type::value ); }; template<class Archive, class T> inline void serialize (Archive &ar, std::complex<T>& z, const unsigned int file_version) { ar & boost::serialization::make_nvp ("real", real(z)); ar & boost::serialization::make_nvp ("imag", imag(z)); } } }

please feel free to add this along with a corresponding test. Robert Ramey http://lists.boost.org/mailman/listinfo.cgi/boost
Since we already support std::complex partially in Boost.MPI this indeed makes sense. It would take only a few minutes. Robert, is it OK with you if I add a serialization/complex.hpp header?
Matthias
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On 13 Nov 2007, at 17:19, Robert Ramey wrote:
please feel free to add this along with a corresponding test.
Done. Matthias
http://lists.boost.org/mailman/listinfo.cgi/boost
Since we already support std::complex partially in Boost.MPI this indeed makes sense. It would take only a few minutes. Robert, is it OK with you if I add a serialization/complex.hpp header?
participants (4)
-
Matthias Schabel
-
Matthias Troyer
-
Neal Becker
-
Robert Ramey