Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-02-28 11:40:04


> void Sensor::send(const SENSOR_Event *event){
> ...
> // serialize to string
> std::stringstream s;
> boost::archive::text_oarchive oa(s);
> //SENSOR_Event tmp = *event;
      const SENSOR_Event tmp = *event;
> oa << tmp;
> std::string p = s.str();
> ...
> }
>

Note that the above change will fix the "problem" . The following would
be much better:

void Sensor::send(const SENSOR_Event * const event){
 // serialize to string
    std::stringstream s;
    boost::archive::text_oarchive oa(s);
    oa << event;
    std::string p = s.str();
}


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