mirror of
https://github.com/boostorg/array.git
synced 2025-06-27 13:01:43 +02:00
Compare commits
1 Commits
svn-branch
...
boost-1.25
Author | SHA1 | Date | |
---|---|---|---|
ae96ee4ab4 |
@ -17,7 +17,7 @@ int main()
|
|||||||
// copy and change order
|
// copy and change order
|
||||||
boost::array<std::string,4> seasons_orig = seasons;
|
boost::array<std::string,4> seasons_orig = seasons;
|
||||||
for (unsigned i=seasons.size()-1; i>0; --i) {
|
for (unsigned i=seasons.size()-1; i>0; --i) {
|
||||||
std::swap(seasons.at(i),seasons.at((i+1)%seasons.size()));
|
swap(seasons.at(i),seasons.at((i+1)%seasons.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "one way: ";
|
std::cout << "one way: ";
|
||||||
@ -25,7 +25,7 @@ int main()
|
|||||||
|
|
||||||
// try swap()
|
// try swap()
|
||||||
std::cout << "other way: ";
|
std::cout << "other way: ";
|
||||||
std::swap(seasons,seasons_orig);
|
swap(seasons,seasons_orig);
|
||||||
print_elements(seasons);
|
print_elements(seasons);
|
||||||
|
|
||||||
// try reverse iterators
|
// try reverse iterators
|
||||||
|
@ -27,8 +27,7 @@ int main()
|
|||||||
// use some common STL container operations
|
// use some common STL container operations
|
||||||
std::cout << "static_size: " << a.size() << std::endl;
|
std::cout << "static_size: " << a.size() << std::endl;
|
||||||
std::cout << "size: " << a.size() << std::endl;
|
std::cout << "size: " << a.size() << std::endl;
|
||||||
// Can't use std::boolalpha because it isn't portable
|
std::cout << "empty: " << std::boolalpha << a.empty() << std::endl;
|
||||||
std::cout << "empty: " << (a.empty()? "true" : "false") << std::endl;
|
|
||||||
std::cout << "max_size: " << a.max_size() << std::endl;
|
std::cout << "max_size: " << a.max_size() << std::endl;
|
||||||
std::cout << "front: " << a.front() << std::endl;
|
std::cout << "front: " << a.front() << std::endl;
|
||||||
std::cout << "back: " << a.back() << std::endl;
|
std::cout << "back: " << a.back() << std::endl;
|
||||||
@ -57,7 +56,7 @@ int main()
|
|||||||
|
|
||||||
typedef boost::array<double,6> DArray;
|
typedef boost::array<double,6> DArray;
|
||||||
typedef boost::array<int,6> IArray;
|
typedef boost::array<int,6> IArray;
|
||||||
IArray ia = { { 1, 2, 3, 4, 5, 6 } } ; // extra braces silence GCC warning
|
IArray ia = { 1, 2, 3, 4, 5, 6 };
|
||||||
DArray da;
|
DArray da;
|
||||||
da = ia;
|
da = ia;
|
||||||
da.assign(42);
|
da.assign(42);
|
||||||
|
@ -53,12 +53,6 @@ namespace boost {
|
|||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
|
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
|
||||||
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)
|
|
||||||
// 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
|
#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;
|
||||||
@ -160,4 +154,3 @@ namespace boost {
|
|||||||
} /* namespace boost */
|
} /* namespace boost */
|
||||||
|
|
||||||
#endif /*BOOST_ARRAY_HPP*/
|
#endif /*BOOST_ARRAY_HPP*/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user