2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-02-24 04:02:19 +00:00

Add const conversion to accomodate open MPI 1.6

This commit is contained in:
Alain Miniussi
2017-07-24 12:39:50 +02:00
parent ee8cf105dd
commit 2c5ec6ef15
2 changed files with 19 additions and 7 deletions

View File

@@ -23,7 +23,18 @@ namespace detail {
template <typename T, typename A>
T const* c_data(std::vector<T,A> const& v) { return &(v[0]); }
// Some old MPI implementation (OpenMPI 1.6 for example) have non
// conforming API w.r.t. constness.
// We choose to fix this trhough this converter in order to
// explain/remember why we're doing this and remove it easilly
// when support for those MPI is dropped.
// The fix is as specific (un templatized, for one) as possible
// in order to encourage it usage for the probleme at hand.
// Problematic API include MPI_Send
inline
void *unconst(void const* addr) { return const_cast<void*>(addr); }
} } }
#endif