aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Edwards <pme@gcc.gnu.org>2002-02-10 09:05:46 +0000
committerPhil Edwards <pme@gcc.gnu.org>2002-02-10 09:05:46 +0000
commit02669b681ed493f523510039c4ee65fd8d569424 (patch)
tree7552b41aa1cee611c27b2e4d471b663d70c7595d
parentc0d88161574d43250b55dd7687ad062f5f7ca803 (diff)
downloadgcc-02669b681ed493f523510039c4ee65fd8d569424.zip
gcc-02669b681ed493f523510039c4ee65fd8d569424.tar.gz
gcc-02669b681ed493f523510039c4ee65fd8d569424.tar.bz2
stl_algo.h (transform (both signatures), generate_n): Use __typeof__ in concept checks.
2002-02-10 Phil Edwards <pme@gcc.gnu.org> * include/bits/stl_algo.h (transform (both signatures), generate_n): Use __typeof__ in concept checks. From-SVN: r49653
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h19
2 files changed, 12 insertions, 12 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index da2f0f7..8789b9f5 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-10 Phil Edwards <pme@gcc.gnu.org>
+
+ * include/bits/stl_algo.h (transform (both signatures), generate_n):
+ Use __typeof__ in concept checks.
+
2002-02-10 Jonathan Wakely <cow@compsoc.man.ac.uk>
* include/bits/stl_algo.h (__median, for_each, find, find_if,
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 501bcf6..653aaa6 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -737,11 +737,9 @@ namespace std
{
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter>)
- /* XXX
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- // should be "the type returned by _UnaryOperation"
- typename iterator_traits<_InputIter>::value_type>)
- */
+ // "the type returned by a _UnaryOperation"
+ __typeof__(__unary_op(*__first))>)
for ( ; __first != __last; ++__first, ++__result)
*__result = __unary_op(*__first);
@@ -775,11 +773,9 @@ namespace std
// concept requirements
__glibcpp_function_requires(_InputIteratorConcept<_InputIter1>)
__glibcpp_function_requires(_InputIteratorConcept<_InputIter2>)
- /* XXX
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- // should be "the type returned by _BinaryOperation"
- typename iterator_traits<_InputIter1>::value_type>)
- */
+ // "the type returned by a _BinaryOperation"
+ __typeof__(__binary_op(*__first1,*__first2))>)
for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result)
*__result = __binary_op(*__first1, *__first2);
@@ -948,11 +944,10 @@ namespace std
_OutputIter
generate_n(_OutputIter __first, _Size __n, _Generator __gen)
{
- /*
- // XXX concept requirements
+ // concept requirements
__glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
- "the return type of _Generator" ?? >)
- */
+ // "the type returned by a _Generator"
+ __typeof__(gen())>)
for ( ; __n > 0; --__n, ++__first)
*__first = __gen();