I have a pickling problem I suspect is just not possible to solve. I have some wrappers around boost::random objects.
There is a rng object, which is a single underlying mersenne twister. There are various distributions. For example, uniform_real. Each uniform_real holds a reference to the single, external mt object. I don't think there's any way to unpickle several instance of uniform_real so that their references to the (shared) mt object get correctly restored. Imagine something like this: class mt; struct uniform_real { mt & _mt; uniform_real (mt &, min, max) ... }; When unpickled, the internal _mt states are saved and restored correctly, but 2 instances of uniform_real will not share a reference to a single mt object, they each have their own copy which starts with a copy of the same state (no good). _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig