From 09c271cf341e62753c9a6063544e589bb57e34ea Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 23 Jan 2002 18:07:11 +0000 Subject: [PATCH] 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] --- array3.cpp | 4 ++-- array5.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/array3.cpp b/array3.cpp index 80ab475..da4691b 100644 --- a/array3.cpp +++ b/array3.cpp @@ -17,7 +17,7 @@ int main() // copy and change order boost::array 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 diff --git a/array5.cpp b/array5.cpp index c2de2d8..d8fd6b7 100644 --- a/array5.cpp +++ b/array5.cpp @@ -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;