
Am Mittwoch, 1. April 2009 21:13:33 schrieb Ion Gaztañaga:
// Check alignment assert((static_cast<void *>(ret->buf) - static_cast<void *>(0)) % Alignment == 0);
Obviously, offset_ptr is not a pointer so it can be static_cast'ed. offset_ptr is a smart pointer that emulates a pointer that can be placed in shared memory. See offset_ptr docs and implementation for more details. Try
// Check alignment assert((static_cast<void *>(ret->buf.get()) - static_cast<void *>(0)) % Alignment == 0);
Indeed. That was what I tried first. But that doesn't work either: The compiler says "invalid use of »void«" However, this does: assert((static_cast<char *>(ret->buf.get()) - static_cast<char *>(0)) % Alignment == 0); The pointer arithmetics need char*. So everything is fine. Thanks a bunch for your help with that great library! Cheers, Stephan