From d578504cfcd5aa9c32bdd43704ec276c63dc71a3 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 7 Jul 2000 16:04:40 +0000 Subject: [PATCH] This commit was generated by cvs2svn to compensate for changes in r4, which included commits to RCS files with non-trunk default branches. [SVN r7621] --- .gitattributes | 96 +++++++++++++++++++++++++++ include/boost/array.hpp | 143 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 239 insertions(+) create mode 100644 .gitattributes create mode 100644 include/boost/array.hpp diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e84d7c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain diff --git a/include/boost/array.hpp b/include/boost/array.hpp new file mode 100644 index 0000000..97c9fb7 --- /dev/null +++ b/include/boost/array.hpp @@ -0,0 +1,143 @@ +// -*-C++-*- array.hpp +// +// +// +// +// +// +// +// +// +// +// + +// Author: Dietmar Kuehl dietmar.kuehl@claas-solutions.de +// Title: STL container support, including support for built-in arrays +// Version: $Id$ + +// -------------------------------------------------------------------------- + +#if !defined(BOOST_ARRAY_HPP) +#define BOOST_ARRAY_HPP 1 + +// -------------------------------------------------------------------------- + +#include + +// -------------------------------------------------------------------------- + +namespace boost +{ + + // --- a general version of container traits ------------------------------ + + template + struct array_traits + { + typedef typename Cont::iterator iter_type; + typedef typename Cont::size_type size_type; + static iter_type begin(Cont &cont) { return cont.begin(); } + static iter_type end(Cont &cont) { return cont.end(); } + static size_type size(Cont &cont) { return cont.size(); } + }; + + // --- a version of container traits for constant constainer -------------- + + template + struct array_traits + { + typedef typename Cont::const_iterator iter_type; + typedef typename Cont::size_type size_type; + static iter_type begin(Cont const &cont) { return cont.begin(); } + static iter_type end(Cont const &cont) { return cont.end(); } + static size_type size(Cont const &cont) { return cont.size(); } + }; + + // --- a special version for non-const built-in arrays -------------------- + + template + struct array_traits + { + typedef T* iter_type; + typedef size_t size_type; + static iter_type begin(T (&array)[sz]) { return array; } + static iter_type end(T (&array)[sz]) { return array + sz; } + static size_type size(T (&)[sz]) { return sz; } + }; + + // --- a special version for const built-in arrays ------------------------ + + template + struct array_traits + { + typedef T const* iter_type; + typedef size_t size_type; + static iter_type begin(T const (&array)[sz]) { return array; } + static iter_type end(T const (&array)[sz]) { return array + sz; } + static size_type size(T const (&array)[sz]) { return sz; } + }; + + template + inline char (&sizer(T (&)[sz]))[sz]; + + // --- general version of the global accessor functions --------------------- + + template + inline typename array_traits::iter_type + begin(Cont &cont) { return array_traits::begin(cont); } + + template + inline typename array_traits::iter_type + end(Cont &cont) { return array_traits::end(cont); } + + template + inline typename array_traits::size_type + size(Cont &cont) { return array_traits::size(cont); } + + // --- Actually the above should be sufficient but compilers seem ----------- + // --- to welcome some help. So here we go: + + template + inline typename array_traits::iter_type + begin(T (&a)[sz]) { return array_traits::begin(a); } + + template + inline typename array_traits::iter_type + end(T (&a)[sz]) { return array_traits::end(a); } + + template + inline typename array_traits::size_type + size(T (&a)[sz]) { return array_traits::size(a); } + + // --- Apparently the compilers also need some specific help, --------------- + + // --- EDG-2.39 wants to pass around pointers in some contexts -------------- +#ifdef __EDG__ + template + struct array_traits + { + typedef T* iter_type; + typedef size_t size_type; + }; +#endif + + // --- egcs-1998-11-22 apparently likes an extra const version: ------------- +#ifdef __GNUG__ + template + inline typename array_traits::iter_type + begin(T const(&a)[sz]) { return array_traits::begin(a); } + + template + inline typename array_traits::iter_type + end(T const(&a)[sz]) { return array_traits::end(a); } + + template + inline typename array_traits::size_type + size(T const (&a)[sz]) { return array_traits::size(a); } +#endif + +} + +// ----------------------------------------------------------------------------- + +#endif /* BOOST_ARRAY_HPP */