
David Bergman wrote:
On Dec 1, 2009, at 12:47 PM, Vladimir Prus wrote:
Robert Ramey wrote:
I didn't have to write even one line to template code to implement the example.
I though boost.serialization was written by you?
The example is quite distinct from the library being used...
In other words, there is a special quality of Boost.Serialization that is of importance: it exists. So, we are allowed to use it, and by using it, we have to write very little code ourselves, beside a number of include statements. Great!
If this new proposed library is accepted, you get to write just as little code, if not less.
And that code still has to be parsed by the compiler.
This is a different issue. Is that your problem, that you think compilers have a problem with some complex constructs inside the Boost.Serialization library? Does the compiler fail? Consume too much resources? Too much time?
Yes, too much time and resources. When building debug variant, an program that does nothing but creates std::vector<int> is a 53K object file. When I add serialization, I get: - a useless warning shown below, and no, I am not willing to apply const_cast or declare things const just because Boost.Serialization has strange position about what const really means - a 387K object file When doing a release build, the source with serialization takes 1.3 second to compile, while the empty one takes 0.3 second. It does not seem like this overhead is justifiable for a trivial task of just getting my std::vector printed. - Volodya ../../../boost/mpl/print.hpp: In instantiation of ‘boost::mpl::print<boost::serialization::STATIC_WARNING_LINE<98> >’: ../../../boost/serialization/static_warning.hpp:92: instantiated from ‘boost::serialization::static_warning_test<false, 98>’ ../../../boost/archive/detail/check.hpp:98: instantiated from ‘void boost::archive::detail::check_object_tracking() [with T = std::vector<int, std::allocator<int> >]’ ../../../boost/archive/detail/oserializer.hpp:313: instantiated from ‘static void boost::archive::detail::save_non_pointer_type<Archive>::invoke(Archive&, T&) [with T = std::vector<int, std::allocator<int> >, Archive = boost::archive::text_oarchive]’ ../../../boost/archive/detail/oserializer.hpp:525: instantiated from ‘void boost::archive::save(Archive&, T&) [with Archive = boost::archive::text_oarchive, T = std::vector<int, std::allocator<int> >]’ ../../../boost/archive/detail/common_oarchive.hpp:69: instantiated from ‘void boost::archive::detail::common_oarchive<Archive>::save_override(T&, int) [with T = std::vector<int, std::allocator<int> >, Archive = boost::archive::text_oarchive]’ ../../../boost/archive/basic_text_oarchive.hpp:80: instantiated from ‘void boost::archive::basic_text_oarchive<Archive>::save_override(T&, int) [with T = std::vector<int, std::allocator<int> >, Archive = boost::archive::text_oarchive]’ ../../../boost/archive/detail/interface_oarchive.hpp:64: instantiated from ‘Archive& boost::archive::detail::interface_oarchive<Archive>::operator<<(T&) [with T = std::vector<int, std::allocator<int> >, Archive = boost::archive::text_oarchive]’ d.cpp:13: instantiated from here ../../../boost/mpl/print.hpp:55: warning: comparison between signed and unsigned integer expressions