Compare commits

..

11 Commits

Author SHA1 Message Date
d335bcbc50 This commit was manufactured by cvs2svn to create tag
'Version_1_29_0'.

[SVN r15904]
2002-10-11 15:17:55 +00:00
b69ab9fa7b This commit was manufactured by cvs2svn to create branch 'RC_1_29_0'.
[SVN r15460]
2002-09-19 20:49:39 +00:00
785e98fcac No sense in failing just because a compiler doesn't implement correct for loop scoping!
[SVN r15327]
2002-09-15 04:04:10 +00:00
13d4e8bc40 Stripped tabs, added VC7+STLport fixes
[SVN r15193]
2002-09-07 10:45:04 +00:00
9ea2182afa One more attempt to get Intel config right.
[SVN r15166]
2002-09-05 10:18:10 +00:00
bf3b240686 Second try at fixing Intel errors, without messing up Intel+STLport config.
[SVN r15141]
2002-09-03 11:34:12 +00:00
6b9c6c9de3 Added (hopeful) Intel C++ fixes for broken std::reverse_iterator.
[SVN r15124]
2002-09-01 10:43:04 +00:00
fe013c42b7 Added a fix for non Microsoft compilers using Microsoft libraries.
[SVN r15068]
2002-08-23 14:32:39 +00:00
b87433497e array5.cpp:
- Add (redundant) braces around initializer to silence GCC


[SVN r12528]
2002-01-27 18:22:19 +00:00
09c271cf34 array3.cpp:
- Qualify std::swap for compilers that don't have Koenig lookup

array5.cpp:
  - Don't use std::boolalpha, because it isn't portable


[SVN r12463]
2002-01-23 18:07:11 +00:00
f5699ae164 Fixed reverse iterator declarations so that they work with VC7b2.
[SVN r12173]
2001-12-29 12:33:32 +00:00
3 changed files with 22 additions and 8 deletions

View File

@ -17,7 +17,7 @@ int main()
// copy and change order
boost::array<std::string,4> seasons_orig = seasons;
for (unsigned i=seasons.size()-1; i>0; --i) {
swap(seasons.at(i),seasons.at((i+1)%seasons.size()));
std::swap(seasons.at(i),seasons.at((i+1)%seasons.size()));
}
std::cout << "one way: ";
@ -25,7 +25,7 @@ int main()
// try swap()
std::cout << "other way: ";
swap(seasons,seasons_orig);
std::swap(seasons,seasons_orig);
print_elements(seasons);
// try reverse iterators

View File

@ -10,8 +10,8 @@ void test_static_size (const T& cont)
for (unsigned i=0; i<T::static_size; ++i) {
tmp[i] = int(cont[i]);
}
for (unsigned i=0; i<T::static_size; ++i) {
std::cout << tmp[i] << ' ';
for (unsigned j=0; j<T::static_size; ++j) {
std::cout << tmp[j] << ' ';
}
std::cout << std::endl;
}
@ -27,7 +27,8 @@ int main()
// use some common STL container operations
std::cout << "static_size: " << a.size() << std::endl;
std::cout << "size: " << a.size() << std::endl;
std::cout << "empty: " << std::boolalpha << a.empty() << std::endl;
// Can't use std::boolalpha because it isn't portable
std::cout << "empty: " << (a.empty()? "true" : "false") << std::endl;
std::cout << "max_size: " << a.max_size() << std::endl;
std::cout << "front: " << a.front() << std::endl;
std::cout << "back: " << a.back() << std::endl;
@ -56,7 +57,7 @@ int main()
typedef boost::array<double,6> DArray;
typedef boost::array<int,6> IArray;
IArray ia = { 1, 2, 3, 4, 5, 6 };
IArray ia = { { 1, 2, 3, 4, 5, 6 } } ; // extra braces silence GCC warning
DArray da;
da = ia;
da.assign(42);

View File

@ -11,6 +11,7 @@
* This software is provided "as is" without express or implied
* 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)
* 20 Jan 2001 - STLport fix (Beman Dawes)
* 29 Sep 2000 - Initial Revision (Nico Josuttis)
@ -20,7 +21,9 @@
#include <cstddef>
#include <stdexcept>
#include <iterator>
// Handles broken standard libraries better than <iterator>
#include <boost/detail/iterator.hpp>
#include <algorithm>
// FIXES for broken compilers
@ -50,9 +53,15 @@ namespace boost {
const_iterator end() const { return elems+N; }
// 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<const_iterator> const_reverse_iterator;
#elif (defined(BOOST_MSVC) && (BOOST_MSVC == 1300) || (defined(__ICL) && defined(_CPPLIB_VER) && (_CPPLIB_VER == 310))) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
// workaround for broken reverse_iterator in VC7
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
reference, iterator, reference> > reverse_iterator;
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
const_reference, iterator, reference> > const_reverse_iterator;
#else
// workaround for broken reverse_iterator implementations
typedef std::reverse_iterator<iterator,T> reverse_iterator;
@ -154,3 +163,7 @@ namespace boost {
} /* namespace boost */
#endif /*BOOST_ARRAY_HPP*/