Boost logo

Boost Users :

Subject: Re: [Boost-users] mpi::allocator::construct function in gcc 4.6.2
From: MM (finjulhich_at_[hidden])
Date: 2012-01-27 15:29:04


> -----Original Message-----
> From: MM [mailto:finjulhich_at_[hidden]]
> Sent: 27 January 2012 18:54
> To: 'boost-users_at_[hidden]'
> Subject: mpi::allocator::construct function in gcc 4.6.2
>
> Hello,
>
> I get the following error:
>
> In file included from /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/vector:64:0,
> from /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/bits/random.h:34,
> from /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/random:50,
> from /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/bits/stl_algo.h:67,
> from /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/algorithm:63,
> from /usr/include/boost/utility/swap.hpp:24,
> from /usr/include/boost/swap.hpp:10,
> from /usr/include/boost/array.hpp:44,
> from /usr/include/boost/serialization/array.hpp:26,
> from
> /usr/include/boost/archive/detail/oserializer.hpp:58,
> from
> /usr/include/boost/mpi/detail/mpi_datatype_oarchive.hpp:14,
> from
> /usr/include/boost/mpi/detail/mpi_datatype_cache.hpp:13,
> from /usr/include/boost/mpi/datatype.hpp:27,
> from /usr/include/boost/mpi/packed_iarchive.hpp:21,
> from /home/hich/trunk/serialization/contract.cpp:3:
> /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/bits/stl_uninitialized.h: In
> function 'void std::__uninitialized_default_n_a(_ForwardIterator,
> _Size, _Allocator&) [with _ForwardIterator = char*, _Size = long
> unsigned int, _Allocator = boost::mpi::allocator<char>]':
> /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/bits/vector.tcc:477:8:
> instantiated from 'void std::vector<_Tp,
> _Alloc>::_M_default_append(std::vector<_Tp, _Alloc>::size_type) [with
> _Tp = char, _Alloc = boost::mpi::allocator<char>, std::vector<_Tp,
> _Alloc>::size_type = long unsigned int]'
> /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/bits/stl_vector.h:592:4:
> instantiated from 'void std::vector<_Tp,
> _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = char,
> _Alloc = boost::mpi::allocator<char>, std::vector<_Tp,
> _Alloc>::size_type = long unsigned int]'
> /usr/include/boost/mpi/detail/packed_iprimitive.hpp:57:23:
> instantiated from here
> /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/bits/stl_uninitialized.h:576:
> 6: error: no matching function for call to
> 'boost::mpi::allocator<char>::construct(char*)'
> /usr/lib/gcc/x86_64-redhat-
> linux/4.6.2/../../../../include/c++/4.6.2/bits/stl_uninitialized.h:576:
> 6: note: candidate is:
> /usr/include/boost/mpi/allocator.hpp:168:8: note: void
> boost::mpi::allocator<T>::construct(boost::mpi::allocator<T>::pointer,
> const T&) [with T = char, boost::mpi::allocator<T>::pointer = char*]
> /usr/include/boost/mpi/allocator.hpp:168:8: note: candidate expects 2
> arguments, 1 provided
>
> I am using c++0x.
>
> Should mpi::allocator::construct() be different? Is it required to
> provide a 1-arg construct()?
>
>
>
> Regards,
>
> MM

I have added a 1-arg construct() that constructs default T()to
mpi::allocator and that seems to compile correctly ,


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net