[mlpack-git] [mlpack/mlpack] Serialize a class with "map<int, Node*>" (#811)

Ryan Curtin notifications at github.com
Tue Nov 15 17:17:47 EST 2016


Sure, I am glad that it helped.

There are two options for serialization support for STL containers that hold mlpack objects: the first is to simply reimplement the STL container serialization support inside the class that uses the container (but that is a little ugly).  The second is a bit uglier:

A class template specialization can be added for each `SecondShim<std::type<...>>` object.  Inside of this  class, the `serialize()` method can be implemented in such a way that it is just the implementation of the STL container's `serialize()` function, except with `BOOST_SERIALIZATION_NVP()` replaced with `ar & data::CreateNVP(...)`.

It would be kind of complex and would require testing (although the test case would be simple... just make sure that `ar & data::CreateNVP(some STL container)` compiles).  I personally don't have any plans to implement this right now, but if you would like to the contribution would be welcome. :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/811#issuecomment-260788088
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20161115/33ff24c7/attachment.html>


More information about the mlpack-git mailing list