diff --git a/include/boost/mpi/detail/antiques.hpp b/include/boost/mpi/detail/antiques.hpp index 0bd235b2..93b8efe9 100644 --- a/include/boost/mpi/detail/antiques.hpp +++ b/include/boost/mpi/detail/antiques.hpp @@ -19,10 +19,10 @@ namespace detail { // serve as an incentive to get rid of this when those compilers // are dropped. template - T* c_data(std::vector& v) { return &(v[0]); } + T* c_data(std::vector& v) { if (v.empty()) return NULL; return &(v[0]); } template - T const* c_data(std::vector const& v) { return &(v[0]); } + T const* c_data(std::vector const& v) { if (v.empty()) return NULL; return &(v[0]); } // Some old MPI implementation (OpenMPI 1.6 for example) have non // conforming API w.r.t. constness.