outside of classes

20 views
Skip to first unread message

David Hysom

unread,
Aug 19, 2020, 11:49:26 AM8/19/20
to cereal serialization library
All your docs -- at least the ones near the beginning -- show how to use cereal inside classes (structs). This does me no good: I need to use it for an STD object outside of a class. I'm sure this is simple, but your docs don't show how (that I could find).

thanks in advance, Dave 

Nikolaus Demmel

unread,
Aug 19, 2020, 1:41:06 PM8/19/20
to cereal serialization library
Does this help: http://uscilab.github.io/cereal/serialization_functions.html ?

Right at the top under "Types of Serialization Functions" it shows the "external" variants.

Best,
Niko

Nikolaus Demmel

unread,
Aug 19, 2020, 1:42:54 PM8/19/20
to cereal serialization library
PS: Chances are there is builtin support for your STL type: http://uscilab.github.io/cereal/stl_support.html

Nikolaus Demmel

unread,
Aug 19, 2020, 4:16:08 PM8/19/20
to cereal serialization library
Not sure exactly what you mean by "deal with an stl object the same way as you do your classes". For your own classes you can either use the internal or external variants. For other people’s classes you can only use the external variant.

But if it’s about serializing STL objects, you might not have to write any serialisers. Just include the corresponding header and you’re good to go: https://github.com/USCiLab/cereal/tree/master/include/cereal/types

I’m sure documentation patches or more concrete suggestions of where exactly you would have found which example useful are welcome, but I’m not a maintainer.

If it’s still unclear, best include an example of what exactly you are actually trying to do.

Best,
Niko



On 19. Aug 2020, at 22:08, David Hysom <dhy...@gmail.com> wrote:

So, I guess I deal with an stl object the same way as you do your classes.
I just find it confusing why you don't show anything like that.
Anyway, thanks for your quick response.

On Wed, Aug 19, 2020 at 10:41 AM Nikolaus Demmel <nde...@gmail.com> wrote:
Does this help: http://uscilab.github.io/cereal/serialization_functions.html ?

Right at the top under "Types of Serialization Functions" it shows the "external" variants.

Best,
Niko

On Wednesday, August 19, 2020 at 5:49:26 PM UTC+2, David Hysom wrote:
All your docs -- at least the ones near the beginning -- show how to use cereal inside classes (structs). This does me no good: I need to use it for an STD object outside of a class. I'm sure this is simple, but your docs don't show how (that I could find).

thanks in advance, Dave 

-- 
You received this message because you are subscribed to a topic in the Google Groups "cereal serialization library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cerealcpp/7G5TkWTwYg4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cerealcpp+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerealcpp/3f75b50c-7c12-4e1c-9ad9-1ab74b5f736do%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages