From eeeb7ef5b9a5c1c02c79bfb230bac5fc05395f88 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 11 Feb 2001 03:12:04 +0000 Subject: [PATCH] Replaced some static_casts with explicit construction [SVN r9107] --- counting_iterator_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/counting_iterator_test.cpp b/counting_iterator_test.cpp index 83577bc..2e113b7 100644 --- a/counting_iterator_test.cpp +++ b/counting_iterator_test.cpp @@ -146,7 +146,7 @@ template void test_container(Container* = 0) // default arg works around MSVC bug { Container c(1 + (unsigned)rand() % 1673); - + const typename Container::iterator start = c.begin(); // back off by 1 to leave room for dereferenceable value at the end @@ -154,9 +154,9 @@ void test_container(Container* = 0) // default arg works around MSVC bug std::advance(finish, c.size() - 1); test(start, finish); - - test(static_cast(start), - static_cast(finish)); + + typedef typename Container::const_iterator const_iterator; + test(const_iterator(start), const_iterator(finish)); } int main() @@ -176,7 +176,7 @@ int main() test_integer(); test_integer(); #endif - // Some tests on container iterators, to prove we handle a few different categories + // Some tests on container iterators, to prove we handle a few different categories test_container >(); test_container >(); #ifndef BOOST_NO_SLIST