diff -Naurd boost/boost/mpi/detail/packed_iprimitive.hpp boost-strings/boost/mpi/detail/packed_iprimitive.hpp
old
|
new
|
|
86 | 86 | load_impl(&t, get_mpi_datatype(t), 1); |
87 | 87 | } |
88 | 88 | |
89 | | void load( std::string & s) |
| 89 | template<typename char_type> |
| 90 | void load( std::basic_string<char_type> & s) |
90 | 91 | { |
91 | 92 | unsigned int l; |
92 | 93 | load(l); |
… |
… |
|
96 | 97 | #endif |
97 | 98 | s.resize(l); |
98 | 99 | // note breaking a rule here - could be a problem on some platform |
99 | | load_impl(const_cast<char *>(s.data()),MPI_CHAR,l); |
100 | | } |
| 100 | load_impl(const_cast<char_type *>(s.data()),MPI_CHAR,l*sizeof(char_type)); |
| 101 | } |
101 | 102 | |
102 | 103 | private: |
103 | 104 | |
104 | 105 | void load_impl(void * p, MPI_Datatype t, int l) |
105 | | { |
| 106 | { |
106 | 107 | BOOST_MPI_CHECK_RESULT(MPI_Unpack, |
107 | 108 | (const_cast<char*>(boost::serialization::detail::get_data(buffer_)), buffer_.size(), &position, p, l, t, comm)); |
108 | | } |
| 109 | } |
109 | 110 | |
110 | 111 | buffer_type & buffer_; |
111 | 112 | mutable std::size_t size_; |
diff -Naurd boost/boost/mpi/detail/packed_oprimitive.hpp boost-strings/boost/mpi/detail/packed_oprimitive.hpp
old
|
new
|
|
77 | 77 | save_impl(&t, get_mpi_datatype<T>(t), 1); |
78 | 78 | } |
79 | 79 | |
80 | | void save(const std::string &s) |
81 | | { |
| 80 | template<typename char_type> |
| 81 | void save(const std::basic_string<char_type> &s) |
| 82 | { |
82 | 83 | unsigned int l = static_cast<unsigned int>(s.size()); |
83 | 84 | save(l); |
84 | | save_impl(s.data(),MPI_CHAR,s.size()); |
85 | | } |
| 85 | save_impl(s.data(),MPI_CHAR,s.size()*sizeof(char_type)); |
| 86 | } |
86 | 87 | |
87 | 88 | private: |
88 | 89 | |