The following is a distilled testcase after the ticket reported at
https://svn.boost.org/trac/boost/ticket/12367
#include
#include
template<typename Allocator>
struct node_base
{
using allocator_type=Allocator;
};
template<typename Allocator>
struct node_impl
{
using value_type=
typename Allocator::template rebind::other::value_type;
};
template<typename Super>
struct trampoline:node_impl<typename Super::allocator_type>{};
template<typename Super>
struct node:Super,trampoline<Super>{};
int main()
{
using node_type=
node<
node<
node_base<
boost::interprocess::allocator<
int,
boost::interprocess::managed_shared_memory::segment_manager
>
>
>
>;
using pointer=boost::interprocess::offset_ptr;
pointer p=nullptr;
bool b=(p==p); // here's the problem
}
This works fine with GCC. When compiled with Visual Studio 2015, we get:
1>------ Build started: Project: borrame2015, Configuration: Debug x64
------
1> sandbox.cpp
1>d:\usr\joaquin\proyectos\boost-repo\trunk\boost\interprocess\detail\mpl.hpp(74):
error C2594: 'argument': ambiguous conversions from
'node>>>>
' to
'node_impl>>
'
1> with
1> [
1> CharType=char,
1>
MemoryAlgorithm=boost::interprocess::rbtree_best_fit,0x00>,
1> IndexType=boost::interprocess::iset_index
1> ]
1> d:\usr\joaquin\proyectos\borrame2015\sandbox.cpp(39): note: see
reference to class template instantiation
'boost::interprocess::ipcdetail::is_convertible' being compiled
1> with
1> [
1>
PointedType=node_impl,0x00>,boost::interprocess::iset_index>>>
1> ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Note that it is the line
bool b=(p==p); // here's the problem
that triggers the problem; if removed, compilation goes fine. Almost
anything in the
testcase program is needed for the problem to arise:
- using node_type=node> --> using node_type=node<...>
(just one node
level): compilation OK
- remove using value_type=... in node_impl: compilation OK
- rebind --> rebind<char>: compilation OK
- use std::allocator rather than boost::interprocess::allocator:
compilation OK
Ion, I'm totally puzzled by this and unable to navigate through the
internals
of Boost.Interprocess. Totally at your disposal if you need further info
or assistance
running tests etc.
Thank you,
Joaquín M López Muñoz