]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/mpi/detail/antiques.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / mpi / detail / antiques.hpp
index 0bd235b2c1a1f9c5953f8c3c73fa78df93c75d91..a84760f8f17e3a72c5fce21540a199aa416bea48 100644 (file)
@@ -19,10 +19,10 @@ namespace detail {
   // serve as an incentive to get rid of this when those compilers 
   // are dropped.
   template <typename T, typename A>
-  T* c_data(std::vector<T,A>& v) { return &(v[0]); }
+  T* c_data(std::vector<T,A>& v) { return v.empty() ? static_cast<T*>(0) : &(v[0]); }
 
   template <typename T, typename A>
-  T const* c_data(std::vector<T,A> const& v) { return &(v[0]); }
+  T const* c_data(std::vector<T,A> const& v) { return v.empty() ? static_cast<T const*>(0) : &(v[0]); }
 
   // Some old MPI implementation (OpenMPI 1.6 for example) have non 
   // conforming API w.r.t. constness.