Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-07-19 14:41:53


Tell me a little more about this.

I presume that you've figured out what you want to do now. How did you come
to a solution to your problem? Did the STATIC_ASSERT indicate some flawed
code? or not? Did the information make sense. Note that I'm adding a short
explanation of this situation to the manual regarding this. But the
existence of the STATIC_ASSERT is still a source of disagreement.

Robert Ramey

Chris Coleman wrote:
> Ok,
>
> I've sice found some information on Object Tracking that suggests the
>
>
> Chris Coleman wrote:
>
>> Hi,
>>
>> I'm having trouble with serializing an object through a pointer to
>> it.
>>
>> The code below works in 1.32, but in 1.33 it gives the errors below.
>> I
>> am using Mac OS X 10.4.2, gcc 4.0.
>>
>> I've had a look at the headers, but my template programming isn't
>> good enough to make too much sense of them. It seems that there is
>> a check
>> to ensure T is not a pointer on line 549 of oserializer.hpp, which is
>> the reason the static assert is failing?
>>
>> Is it correct that objects shouldn't be serializable by pointers to
>> them, or not?
>>
>> Cheers
>> Chris
>>
>>
>> gps_position* p_g = new gps_position(35, 59, 24.567f);
>> oa << p_g; // causes the error's below
>>
>>
>> g++ -o test test.cpp -lboost_serialization-d-1_33
>> /usr/local/include/boost/archive/detail/oserializer.hpp: In function
>> 'void boost::archive::save(Archive&, T&) [with Archive =
>> boost::archive::text_oarchive, T = gps_position*]':
>> /usr/local/include/boost/archive/basic_text_oarchive.hpp:78:
>> instantiated from 'void
>> boost::archive::basic_text_oarchive<Archive>::save_override(T&, int)
>> [with T = gps_position*, Archive = boost::archive::text_oarchive]'
>> /usr/local/include/boost/archive/detail/interface_oarchive.hpp:85:
>> instantiated from 'Archive&
>> boost::archive::detail::interface_oarchive<Archive>::operator<<(T&)
>> [with T = gps_position*, Archive = boost::archive::text_oarchive]'
>> hash_test.cpp:130: instantiated from here
>> /usr/local/include/boost/archive/detail/oserializer.hpp:560: error:
>> invalid application of 'sizeof' to incomplete type
>> 'boost::STATIC_ASSERTION_FAILURE<false>'
>>
>>
>>
>> This message has been checked for viruses but the contents of an
>> attachment may still contain software viruses, which could damage
>> your computer system: you are advised to perform your own checks.
>> Email communications with the University of Nottingham may be
>> monitored as permitted by UK legislation.
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
>>
>
>
> This message has been checked for viruses but the contents of an
> attachment may still contain software viruses, which could damage
> your computer system: you are advised to perform your own checks.
> Email communications with the University of Nottingham may be
> monitored as permitted by UK legislation.


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