Newbie error trying to construct an offset_ptr in a managed shared memory segment.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Newbie error trying to construct an offset_ptr in a managed shared memory segment.

Boost - Users mailing list
This must be really dumb, because I can't even get the code to compile. I'm using VS2017 Pro and Boost 1.69.0.

The lines of code I'm having trouble with read:
_dataBuffer = _sharedMemorySegment.construct<byte>(DataBufferName)[DataBufferSize](0);
_dataBufferFree = _sharedMemorySegment.construct<size_t>(DataBufferFreeName)(DataBufferSize);
_dataBufferInPointer = _sharedMemorySegment.construct<byte_offset_t >(DataBufferInName)(0);

I get the following error referencing the last line:
Severity Code Description Project File Line Suppression State
Error C2664 'boost::interprocess::offset_ptr<byte,ptrdiff_t,uintptr_t,0>::offset_ptr(const boost::interprocess::offset_ptr<byte,ptrdiff_t,uintptr_t,0> &) noexcept': cannot convert argument 1 from 'T' to 'unsigned char *' EncodingService c:\program files\boost\boost_1_67_0\boost_1_69_0\boost\interprocess\detail\named_proxy.hpp 85

Any help would be greatly appreciated!




Sincerely,


Bill Baker
------------------------------------------------

Nordic Backup, Inc.
600 Rinehart Road, Suite 3050

Lake Mary, FL 32746
P: +1.888.668.0447
E: [hidden email]
W: https://nordic-backup.com
------------------------------------------------


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users