|
Boost : |
Subject: [boost] [sandbox.move] coexistence issues with boost.interprocess + small suggestion
From: Jeffrey Hellrung (jhellrung_at_[hidden])
Date: 2009-07-09 08:20:44
Hi,
I suppose this is mostly addressed to Ion.
It appears that containers in the move library in the boost sandbox
can't coexist with containers from the boost.interprocess library. This
isn't a problem for me currently (I can just use the containers from the
move library), but it may be an indication of a larger problem with
either or both libraries, so I figured it'd be worth sharing. I wasn't
sure if this would be an appropriate trac ticket to file under
boost.interprocess, as it involves technically non-boost code, but I can
certainly do that if desired.
So to be specific, the following program fails to compile (MSVC 2009,
boost 1.39, include paths are boost root and
$(BOOST_SVN)/boost-sandbox/move):
--------
#include <boost/interprocess/containers/vector.hpp>
#include <boost/container/vector.hpp>
int main(int argc, char* argv[])
{
boost::interprocess::vector< int > v1; // line 6
boost::container::vector< int > v2; // line 7
return 0;
}
--------
The compiler output is:
--------
1>.\main.cpp(7) : error C3083: 'container': the symbol to the left of a
'::' must be a type
1>.\main.cpp(7) : error C2039: 'vector' : is not a member of 'boost'
1>.\main.cpp(7) : error C2065: 'vector' : undeclared identifier
1>.\main.cpp(7) : error C2062: type 'int' unexpected
--------
Removing either the interprocess vector (include directive, variable
declaration) pair or the move vector (include directive, variable
declaration) pair produces a compilable program.
Reversing the order of the include directives gives a different compiler
error:
--------
1>E:\boost_1_39_0\boost/interprocess/containers/vector.hpp(24) : error
C3083: 'interprocess_container': the symbol to the left of a '::' must
be a type
1>E:\boost_1_39_0\boost/interprocess/containers/vector.hpp(24) : error
C2039: 'vector' : is not a member of 'boost'
1>E:\boost_1_39_0\boost/interprocess/containers/vector.hpp(24) : error
C2873: 'vector' : symbol cannot be used in a using-declaration
1>.\main.cpp(6) : error C2039: 'vector' : is not a member of
'boost::interprocess'
1>.\main.cpp(6) : error C2065: 'vector' : undeclared identifier
1>.\main.cpp(6) : error C2062: type 'int' unexpected
--------
Any idea what's going on here? Am I just doing something really
boneheaded, e.g., with the include paths?
Additionally, I have a small suggestion for the move library. It would
be somewhat more convenient if boost::is_movable<T> had a nested type
typedef, e.g., if it inherited from mpl::bool_<...> or
integral_constant< bool, ...>. As it stands, I don't think it can be
used directly in MPL expressions such as mpl::and_.
Thanks in advance,
- Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk