mirror of
https://github.com/boostorg/array.git
synced 2025-06-26 20:41:36 +02:00
Compare commits
12 Commits
svn-branch
...
boost-1.30
Author | SHA1 | Date | |
---|---|---|---|
63c804495c | |||
721390991a | |||
3daa34744f | |||
0f3969f9e0 | |||
c501468b53 | |||
faf0005e86 | |||
785e98fcac | |||
13d4e8bc40 | |||
9ea2182afa | |||
bf3b240686 | |||
6b9c6c9de3 | |||
fe013c42b7 |
@ -1,9 +1,16 @@
|
|||||||
/* simple example for using class array<>
|
/* simple example for using class array<>
|
||||||
|
*
|
||||||
|
* (C) Copyright Nicolai M. Josuttis 2001.
|
||||||
|
* Permission to copy, use, modify, sell and distribute this software
|
||||||
|
* is granted provided this copyright notice appears in all copies.
|
||||||
|
* This software is provided "as is" without express or implied
|
||||||
|
* warranty, and with no claim as to its suitability for any purpose.
|
||||||
*
|
*
|
||||||
* Changelog:
|
* Changelog:
|
||||||
* 20 Jan 2001 - Removed boolalpha use since stock GCC doesn't support it
|
* 20 Jan 2001 - Removed boolalpha use since stock GCC doesn't support it
|
||||||
* (David Abrahams)
|
* (David Abrahams)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
/* example for using class array<>
|
/* example for using class array<>
|
||||||
|
* (C) Copyright Nicolai M. Josuttis 2001.
|
||||||
|
* Permission to copy, use, modify, sell and distribute this software
|
||||||
|
* is granted provided this copyright notice appears in all copies.
|
||||||
|
* This software is provided "as is" without express or implied
|
||||||
|
* warranty, and with no claim as to its suitability for any purpose.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
/* example for using class array<>
|
/* example for using class array<>
|
||||||
|
* (C) Copyright Nicolai M. Josuttis 2001.
|
||||||
|
* Permission to copy, use, modify, sell and distribute this software
|
||||||
|
* is granted provided this copyright notice appears in all copies.
|
||||||
|
* This software is provided "as is" without express or implied
|
||||||
|
* warranty, and with no claim as to its suitability for any purpose.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
/* example for using class array<>
|
/* example for using class array<>
|
||||||
|
* (C) Copyright Nicolai M. Josuttis 2001.
|
||||||
|
* Permission to copy, use, modify, sell and distribute this software
|
||||||
|
* is granted provided this copyright notice appears in all copies.
|
||||||
|
* This software is provided "as is" without express or implied
|
||||||
|
* warranty, and with no claim as to its suitability for any purpose.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
10
array5.cpp
10
array5.cpp
@ -1,5 +1,11 @@
|
|||||||
/* simple example for using class array<>
|
/* simple example for using class array<>
|
||||||
|
* (C) Copyright Nicolai M. Josuttis 2001.
|
||||||
|
* Permission to copy, use, modify, sell and distribute this software
|
||||||
|
* is granted provided this copyright notice appears in all copies.
|
||||||
|
* This software is provided "as is" without express or implied
|
||||||
|
* warranty, and with no claim as to its suitability for any purpose.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
|
|
||||||
@ -10,8 +16,8 @@ void test_static_size (const T& cont)
|
|||||||
for (unsigned i=0; i<T::static_size; ++i) {
|
for (unsigned i=0; i<T::static_size; ++i) {
|
||||||
tmp[i] = int(cont[i]);
|
tmp[i] = int(cont[i]);
|
||||||
}
|
}
|
||||||
for (unsigned i=0; i<T::static_size; ++i) {
|
for (unsigned j=0; j<T::static_size; ++j) {
|
||||||
std::cout << tmp[i] << ' ';
|
std::cout << tmp[j] << ' ';
|
||||||
}
|
}
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -11,16 +11,22 @@
|
|||||||
* This software is provided "as is" without express or implied
|
* This software is provided "as is" without express or implied
|
||||||
* warranty, and with no claim as to its suitability for any purpose.
|
* warranty, and with no claim as to its suitability for any purpose.
|
||||||
*
|
*
|
||||||
|
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
|
||||||
* 05 Aug 2001 - minor update (Nico Josuttis)
|
* 05 Aug 2001 - minor update (Nico Josuttis)
|
||||||
* 20 Jan 2001 - STLport fix (Beman Dawes)
|
* 20 Jan 2001 - STLport fix (Beman Dawes)
|
||||||
* 29 Sep 2000 - Initial Revision (Nico Josuttis)
|
* 29 Sep 2000 - Initial Revision (Nico Josuttis)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// See http://www.boost.org/libs/array for Documentation.
|
||||||
|
|
||||||
#ifndef BOOST_ARRAY_HPP
|
#ifndef BOOST_ARRAY_HPP
|
||||||
#define BOOST_ARRAY_HPP
|
#define BOOST_ARRAY_HPP
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iterator>
|
|
||||||
|
// Handles broken standard libraries better than <iterator>
|
||||||
|
#include <boost/detail/iterator.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
// FIXES for broken compilers
|
// FIXES for broken compilers
|
||||||
@ -50,15 +56,15 @@ namespace boost {
|
|||||||
const_iterator end() const { return elems+N; }
|
const_iterator end() const { return elems+N; }
|
||||||
|
|
||||||
// reverse iterator support
|
// reverse iterator support
|
||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
|
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
|
#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
|
||||||
// workaround for broken reverse_iterator in VC7
|
// workaround for broken reverse_iterator in VC7
|
||||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
|
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
|
||||||
reference, iterator, reference> > reverse_iterator;
|
reference, iterator, reference> > reverse_iterator;
|
||||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
|
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
|
||||||
const_reference, iterator, reference> > const_reverse_iterator;
|
const_reference, iterator, reference> > const_reverse_iterator;
|
||||||
#else
|
#else
|
||||||
// workaround for broken reverse_iterator implementations
|
// workaround for broken reverse_iterator implementations
|
||||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
||||||
@ -161,3 +167,9 @@ namespace boost {
|
|||||||
|
|
||||||
#endif /*BOOST_ARRAY_HPP*/
|
#endif /*BOOST_ARRAY_HPP*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user