Chris@16: // (C) Copyright 2005 Matthias Troyer Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org for updates, documentation, and revision history. Chris@16: Chris@16: #ifndef BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP Chris@16: #define BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@101: #if defined(_MSC_VER) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) Chris@16: #define STD _STLP_STD Chris@16: #else Chris@16: #define STD std Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace serialization { Chris@16: namespace detail { Chris@16: Chris@16: template Chris@16: T* get_data(STD::vector& v) Chris@16: { Chris@16: return v.empty() ? 0 : &(v[0]); Chris@16: } Chris@16: Chris@16: template Chris@16: T* get_data(STD::vector const & v) Chris@16: { Chris@16: return get_data(const_cast&>(v)); Chris@16: } Chris@16: Chris@16: template Chris@16: T* get_data(STD::valarray& v) Chris@16: { Chris@16: return v.size()==0 ? 0 : &(v[0]); Chris@16: } Chris@16: Chris@16: template Chris@16: const T* get_data(STD::valarray const& v) Chris@16: { Chris@16: return get_data(const_cast&>(v)); Chris@16: } Chris@16: Chris@16: } // detail Chris@16: } // serialization Chris@16: } // boost Chris@16: Chris@16: #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) Chris@16: #undef STD Chris@16: #endif Chris@16: Chris@16: #endif // BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP