Update of /cvsroot/boost/boost/boost/serialization/detail
In directory 
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24259/boost/serialization/detail

Modified Files:
        get_data.hpp 
Log Message:
Fixd zero length bug


Index: get_data.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/serialization/detail/get_data.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- get_data.hpp        30 Apr 2006 23:58:59 -0000      1.2
+++ get_data.hpp        22 Sep 2006 17:56:59 -0000      1.3
@@ -28,7 +28,7 @@
 template <class T, class Allocator>
 T* get_data(STD::vector<T,Allocator>& v)
 {
-  return &(v[0]);
+  return v.empty() ? 0 : &(v[0]);
 }
 
 template <class T, class Allocator>
@@ -41,7 +41,7 @@
 template <class T>
 T* get_data(STD::valarray<T>& v)
 {
-  return &(v[0]);
+  return v.size()==0 ? 0 : &(v[0]);
 }
 
 template <class T>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to