Using boost 1.48 and vs2010 gives me an error when trying to use
boost::container::string.
#include
int main( int, char *[] )
{
using boost::container::string;
string hello = "hello ";
string world = "world";
string hello_world = hello + world;
}
1>d:\sdk\boost_1_48_0\boost\container\string.hpp(2368): error C2248:
'boost::container::containers_detail::basic_string_base ::alloc' : cannot
access protected member declared in class
'boost::container::containers_detail::basic_string_base '
1> with
1> [
1> A=std::allocator<char>
1> ]
1> d:\sdk\boost_1_48_0\boost\container\string.hpp(214) : see
declaration of 'boost::container::containers_detail::basic_string_base
::alloc'
1> with
1> [
1> A=std::allocator<char>
1> ]
1> d:\tmp\xxx.cpp(15) : see reference to function template
instantiation 'boost::container::basic_string
boost::container::operator
+,std::allocator<_Ty>>(const
boost::container::basic_string &,const
boost::container::basic_string &)' being compiled
1> with
1> [
1> CharT=char,
1> Traits=std::char_traits<char>,
1> A=std::allocator<char>,
1> _Ty=char
1> ]
1> d:\tmp\xxx.cpp(20) : see reference to function template
instantiation 'void hello_world_testboost::container::string(void)' being
compiled
1>
template
inline basic_string
operator+(const basic_string& x, const
basic_string& y)
{
...
str_t result(reserve, x.size() + y.size(), x.alloc());
...
}
should this maybe be x.get_allocator() instead of x.alloc()?
--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-Container-string-operator-problem-t...
Sent from the Boost - Users mailing list archive at Nabble.com.