Boost logo

Boost Users :

Subject: Re: [Boost-users] Serialization] Non-default constructor and static data members
From: Mccall, Kurt E. (JSC-EG411) (kurt.e.mccall_at_[hidden])
Date: 2015-06-04 15:43:48


Robert, thanks for the reply -- I won't attempt to serialize the static
const members.
Also, it looks like if the members is static but not const and defined
outside of the
class, the linker finds it just fine, when it is referenced in
save_construct_data().

Kurt

>
>I'm not so sure about that. There no need to serialize the static const
>values since they are fixed and initialized before the first instance is
>constructed.
>
>It has always been that static variables had to be explicitly
>initialized outside the class. As in
>
>const int A::var1 = 1; // no longer necessary
>const int A::var2 = 2;
>
>But I guess C++11 changed that.
>
>Robert Ramey
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net