diff options
author | François Dumont <francois.cppdevs@free.fr> | 2010-01-28 23:29:52 +0100 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-01-28 22:29:52 +0000 |
commit | a2fe92030ce71454f728bc2e102a320b462b3bbc (patch) | |
tree | 1022289d1470b34ec03adc2867963a802f51bd3e | |
parent | 6684eb28f6c4fa031e6959d7826ae0a3e2b846d5 (diff) | |
download | gcc-a2fe92030ce71454f728bc2e102a320b462b3bbc.zip gcc-a2fe92030ce71454f728bc2e102a320b462b3bbc.tar.gz gcc-a2fe92030ce71454f728bc2e102a320b462b3bbc.tar.bz2 |
stl_algobase.h (struct __iter_base): Add.
2010-01-28 François Dumont <francois.cppdevs@free.fr>
* include/bits/stl_algobase.h (struct __iter_base): Add.
(__niter_base, __miter_base): Adjust, use the latter.
From-SVN: r156335
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_algobase.h | 38 |
2 files changed, 21 insertions, 22 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 776e4fe5..6542223 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2010-01-28 François Dumont <francois.cppdevs@free.fr> + + * include/bits/stl_algobase.h (struct __iter_base): Add. + (__niter_base, __miter_base): Adjust, use the latter. + 2010-01-28 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/21_strings/basic_string/element_access/char/21674.cc: diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index bc04723..5f6c648 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -1,6 +1,6 @@ // Core algorithmic facilities -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -259,11 +259,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } - // If _Iterator is a __normal_iterator return its base (a plain pointer, - // normally) otherwise return it untouched. See copy, fill, ... - template<typename _Iterator, - bool _IsNormal = __is_normal_iterator<_Iterator>::__value> - struct __niter_base + // If _Iterator has a base returns it otherwise _Iterator is returned + // untouched + template<typename _Iterator, bool _HasBase> + struct __iter_base { static _Iterator __b(_Iterator __it) @@ -271,30 +270,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std) }; template<typename _Iterator> - struct __niter_base<_Iterator, true> + struct __iter_base<_Iterator, true> { static typename _Iterator::iterator_type __b(_Iterator __it) { return __it.base(); } }; - // Likewise, for move_iterator. - template<typename _Iterator, - bool _IsMove = __is_move_iterator<_Iterator>::__value> - struct __miter_base - { - static _Iterator - __b(_Iterator __it) - { return __it; } - }; + // If _Iterator is a __normal_iterator return its base (a plain pointer, + // normally) otherwise return it untouched. See copy, fill, ... + template<typename _Iterator> + struct __niter_base + : __iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value> + { }; + // Likewise, for move_iterator. template<typename _Iterator> - struct __miter_base<_Iterator, true> - { - static typename _Iterator::iterator_type - __b(_Iterator __it) - { return __it.base(); } - }; + struct __miter_base + : __iter_base<_Iterator, __is_move_iterator<_Iterator>::__value> + { }; // All of these auxiliary structs serve two purposes. (1) Replace // calls to copy with memmove whenever possible. (Memmove, not memcpy, |