forked from boostorg/array
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]
This commit is contained in:
96
.gitattributes
vendored
Normal file
96
.gitattributes
vendored
Normal file
@ -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
|
143
include/boost/array.hpp
Normal file
143
include/boost/array.hpp
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
// -*-C++-*- array.hpp
|
||||||
|
// <!!---------------------------------------------------------------------->
|
||||||
|
// <!! Copyright (C) 1998 Dietmar Kuehl, Claas Solutions GmbH >
|
||||||
|
// <!!>
|
||||||
|
// <!! Permission to use, copy, modify, distribute and sell this >
|
||||||
|
// <!! software for any purpose is hereby granted without fee, provided >
|
||||||
|
// <!! that the above copyright notice appears in all copies and that >
|
||||||
|
// <!! both that copyright notice and this permission notice appear in >
|
||||||
|
// <!! supporting documentation. Dietmar Kuehl and Claas Solutions make no >
|
||||||
|
// <!! representations about the suitability of this software for any >
|
||||||
|
// <!! purpose. It is provided "as is" without express or implied warranty. >
|
||||||
|
// <!!---------------------------------------------------------------------->
|
||||||
|
|
||||||
|
// 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 <cstddef>
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
|
// --- a general version of container traits ------------------------------
|
||||||
|
|
||||||
|
template <typename Cont>
|
||||||
|
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 <typename Cont>
|
||||||
|
struct array_traits<Cont const>
|
||||||
|
{
|
||||||
|
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 <typename T, size_t sz>
|
||||||
|
struct array_traits<T[sz]>
|
||||||
|
{
|
||||||
|
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 <typename T, size_t sz>
|
||||||
|
struct array_traits<T const[sz]>
|
||||||
|
{
|
||||||
|
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 <typename T, int sz>
|
||||||
|
inline char (&sizer(T (&)[sz]))[sz];
|
||||||
|
|
||||||
|
// --- general version of the global accessor functions ---------------------
|
||||||
|
|
||||||
|
template <typename Cont>
|
||||||
|
inline typename array_traits<Cont>::iter_type
|
||||||
|
begin(Cont &cont) { return array_traits<Cont>::begin(cont); }
|
||||||
|
|
||||||
|
template <typename Cont>
|
||||||
|
inline typename array_traits<Cont>::iter_type
|
||||||
|
end(Cont &cont) { return array_traits<Cont>::end(cont); }
|
||||||
|
|
||||||
|
template <typename Cont>
|
||||||
|
inline typename array_traits<Cont>::size_type
|
||||||
|
size(Cont &cont) { return array_traits<Cont>::size(cont); }
|
||||||
|
|
||||||
|
// --- Actually the above should be sufficient but compilers seem -----------
|
||||||
|
// --- to welcome some help. So here we go:
|
||||||
|
|
||||||
|
template <typename T, size_t sz>
|
||||||
|
inline typename array_traits<T[sz]>::iter_type
|
||||||
|
begin(T (&a)[sz]) { return array_traits<T[sz]>::begin(a); }
|
||||||
|
|
||||||
|
template <typename T, size_t sz>
|
||||||
|
inline typename array_traits<T[sz]>::iter_type
|
||||||
|
end(T (&a)[sz]) { return array_traits<T[sz]>::end(a); }
|
||||||
|
|
||||||
|
template <typename T, size_t sz>
|
||||||
|
inline typename array_traits<T[sz]>::size_type
|
||||||
|
size(T (&a)[sz]) { return array_traits<T[sz]>::size(a); }
|
||||||
|
|
||||||
|
// --- Apparently the compilers also need some specific help, ---------------
|
||||||
|
|
||||||
|
// --- EDG-2.39 wants to pass around pointers in some contexts --------------
|
||||||
|
#ifdef __EDG__
|
||||||
|
template <typename T>
|
||||||
|
struct array_traits<T*>
|
||||||
|
{
|
||||||
|
typedef T* iter_type;
|
||||||
|
typedef size_t size_type;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// --- egcs-1998-11-22 apparently likes an extra const version: -------------
|
||||||
|
#ifdef __GNUG__
|
||||||
|
template <typename T, size_t sz>
|
||||||
|
inline typename array_traits<T const[sz]>::iter_type
|
||||||
|
begin(T const(&a)[sz]) { return array_traits<T const[sz]>::begin(a); }
|
||||||
|
|
||||||
|
template <typename T, size_t sz>
|
||||||
|
inline typename array_traits<T const[sz]>::iter_type
|
||||||
|
end(T const(&a)[sz]) { return array_traits<T const[sz]>::end(a); }
|
||||||
|
|
||||||
|
template <typename T, size_t sz>
|
||||||
|
inline typename array_traits<T const[sz]>::size_type
|
||||||
|
size(T const (&a)[sz]) { return array_traits<T const[sz]>::size(a); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#endif /* BOOST_ARRAY_HPP */
|
Reference in New Issue
Block a user