Closed addy90 closed 1 year ago
Thank you for your fix earlier this year. However, I cannot find the fix in the current Boost 1.83 version (and also not 1.82), see for example: https://www.boost.org/doc/libs/1_83_0/doc/html/interprocess/acknowledgements_notes.html#interprocess.acknowledgements_notes.release_notes The release notes concerning this fix are missing. I would be glad if you could look into it!
Dear Boost colleagues,
I am encountering a quite annoying compilation error that arises in combination with boost::geometry.
Please see this code:
It is compiled under Ubuntu 20.04 LTS with GCC 9.4.0 with the following command, when boost 1.81.0 exists under boost-build/include directory: \
g++ -pthread -isystem boost-build/include -o proxy proxy.cpp -lpthread -lrt
or without linking: \g++ -isystem boost-build/include -o proxy.cpp.o -c proxy.cpp
By the way, CLang10 also gives a similar error.The following error is given:
The error comes from here (get() call in Line 85): \ https://github.com/boostorg/interprocess/blob/a0c5a8ff176434c9024d4540ce092a2eebb8c5c3/include/boost/interprocess/detail/named_proxy.hpp#L85
The get() method somehow is redirected to the boost::geometry get() method with a similar template syntax here: \ https://github.com/boostorg/geometry/blob/dfcbb756021d1d5f4afa262413aa85515b9fd18e/include/boost/geometry/core/access.hpp#L268
It does not make any sense for me, I have no idea why this redirection happens.
Now for the fix of this issue: \ When I add to the boost::interprocess get() call in Line 85 (and Line 81 above to be sure) the
ipcdetail::
namespace in front: \ipcdetail::get<IdxPack>(args_)
\ then the compilation and execution works.I don't understand why the get() call is redirected to boost::geometry, maybe the
using
declaration from here is creating a namespace conflict: \ https://github.com/boostorg/interprocess/blob/a0c5a8ff176434c9024d4540ce092a2eebb8c5c3/include/boost/interprocess/detail/variadic_templates_tools.hpp#L31 By calling get() explicitly by prependingipcdetail::
the compilation works.By the way, prepending directly
container::dtl::
instead ofipcdetail::
also works, of course! Maybe this would be even better. I think, the wholeboost/interprocess/detail/variadic_templates_tools.hpp
should be removed and all calls made explicit, just to be sure that no other namespace conflicts arise.Would it be possible to change the calls to the get() methods to the more explicit ones, so that there is no namespace conflict with the get() methods from boost::geometry?
One very interesting aspect for me is the following: When I change in my code line 15 from
into
then the compilation also works. However, I need geographic coordinate system, so this workaround is no solution. I also don't really understand why this template change alters the result of the compilers.
There might also be other such edge cases still unknown with different libraries having similar templated get() methods, resulting in similar namespace conflicts, but I only know of this one so far.
EDIT: Another workaround that I found just now is using a non-templated wrapper object with move-construction, for example:
This workaround now works in combination with the geographic setting, the get() method is not misrouted this way.
Thank you for your assistance!