From 1a277d94fe2581d1d51a77fd25ae9c3cec1b75c2 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 25 Jun 2004 10:51:45 +0000 Subject: [PATCH] stl_algobase.h (fill, fill_n): Tighten the dispatch: use iterator_traits<>::value_type, not _Tp. 2004-06-25 Paolo Carlini * include/bits/stl_algobase.h (fill, fill_n): Tighten the dispatch: use iterator_traits<>::value_type, not _Tp. From-SVN: r83648 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/bits/stl_algobase.h | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d86adfbdc2e..3e76dd77474 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2004-06-25 Paolo Carlini + + * include/bits/stl_algobase.h (fill, fill_n): Tighten the + dispatch: use iterator_traits<>::value_type, not _Tp. + 2004-06-25 Paolo Carlini * testsuite/25_algorithms/fill/1.cc: Tweak instantiations. diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 0db0ef7daac..1259f957689 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -546,7 +546,8 @@ namespace std _ForwardIterator>) __glibcxx_requires_valid_range(__first, __last); - typedef typename __type_traits<_Tp>::has_trivial_copy_constructor + typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; + typedef typename __type_traits<_ValueType>::has_trivial_copy_constructor _Trivial; std::__fill<_Trivial>::fill(__first, __last, __value); } @@ -621,7 +622,8 @@ namespace std // concept requirements __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _Tp>) - typedef typename __type_traits<_Tp>::has_trivial_copy_constructor + typedef typename iterator_traits<_OutputIterator>::value_type _ValueType; + typedef typename __type_traits<_ValueType>::has_trivial_copy_constructor _Trivial; return std::__fill_n<_Trivial>::fill_n(__first, __n, __value); }