annotate DEPENDENCIES/generic/include/boost/serialization/detail/get_data.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 // (C) Copyright 2005 Matthias Troyer
Chris@16 2 // Use, modification and distribution is subject to the Boost Software
Chris@16 3 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 4 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5
Chris@16 6 // See http://www.boost.org for updates, documentation, and revision history.
Chris@16 7
Chris@16 8 #ifndef BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
Chris@16 9 #define BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
Chris@16 10
Chris@16 11 // MS compatible compilers support #pragma once
Chris@101 12 #if defined(_MSC_VER)
Chris@16 13 # pragma once
Chris@16 14 #endif
Chris@16 15
Chris@16 16 #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
Chris@16 17 #define STD _STLP_STD
Chris@16 18 #else
Chris@16 19 #define STD std
Chris@16 20 #endif
Chris@16 21
Chris@16 22 #include <vector>
Chris@16 23 #include <valarray>
Chris@16 24
Chris@16 25 namespace boost {
Chris@16 26 namespace serialization {
Chris@16 27 namespace detail {
Chris@16 28
Chris@16 29 template <class T, class Allocator>
Chris@16 30 T* get_data(STD::vector<T,Allocator>& v)
Chris@16 31 {
Chris@16 32 return v.empty() ? 0 : &(v[0]);
Chris@16 33 }
Chris@16 34
Chris@16 35 template <class T, class Allocator>
Chris@16 36 T* get_data(STD::vector<T,Allocator> const & v)
Chris@16 37 {
Chris@16 38 return get_data(const_cast<STD::vector<T,Allocator>&>(v));
Chris@16 39 }
Chris@16 40
Chris@16 41 template <class T>
Chris@16 42 T* get_data(STD::valarray<T>& v)
Chris@16 43 {
Chris@16 44 return v.size()==0 ? 0 : &(v[0]);
Chris@16 45 }
Chris@16 46
Chris@16 47 template <class T>
Chris@16 48 const T* get_data(STD::valarray<T> const& v)
Chris@16 49 {
Chris@16 50 return get_data(const_cast<STD::valarray<T>&>(v));
Chris@16 51 }
Chris@16 52
Chris@16 53 } // detail
Chris@16 54 } // serialization
Chris@16 55 } // boost
Chris@16 56
Chris@16 57 #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
Chris@16 58 #undef STD
Chris@16 59 #endif
Chris@16 60
Chris@16 61 #endif // BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP