#include <cereal\types\queue.hpp>
...
namespace sys
{
class base
{
protected:
unsigned priority__power_distribution;
struct pless : public std::binary_function<std::shared_ptr<sys::base>, std::shared_ptr<sys::base>, bool>
{
bool operator()(std::shared_ptr<sys::base> x, std::shared_ptr<sys::base> y) const
{
return std::less<unsigned>()(x->priority__power_distribution, y->priority__power_distribution);
}
};
std::priority_queue<std::shared_ptr<sys::base>, std::vector<std::shared_ptr<sys::base>>, pless> sub_list;
friend class cereal::access;
template<class archive>
void serialize(archive &arch)
{
arch(CEREAL_NVP(sub_list));
}
};
ofstream os("cereal.json");shared_ptr<sys::base> reactor = make_shared<sys::base>();shared_ptr<sys::base> battery = make_shared<sys::base>);
{
cereal::JSONOutputArchive oa(os);
oa(reactor, battery);
}
os.close();
--
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/D69x2HcgW-4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cerealcpp+...@googlegroups.com.
To post to this group, send email to cere...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerealcpp/6f37cd86-999e-4ed6-a46a-450c1679bc46%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to cerealcpp+unsubscribe@googlegroups.com.
To post to this group, send email to cere...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerealcpp/6f37cd86-999e-4ed6-a46a-450c1679bc46%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to cerealcpp+...@googlegroups.com.
To post to this group, send email to cere...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerealcpp/6f37cd86-999e-4ed6-a46a-450c1679bc46%40googlegroups.com.
--
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/D69x2HcgW-4/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/af2f8367-2f5d-4e63-bfc0-bf1336ddf254%40googlegroups.com.