-----Original Message----- From: MM [mailto:finjulhich@gmail.com] Sent: 27 January 2012 18:54 To: 'boost-users@lists.boost.org' 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 ,