libstdc++: Implement ranges [specialized.algorithms]
authorPatrick Palka <ppalka@redhat.com>
Wed, 12 Feb 2020 17:54:47 +0000 (12:54 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 13 Feb 2020 20:22:28 +0000 (15:22 -0500)
commit613c932f5e5c0cc2e4b88e21d9870fa7b1a6ce5d
tree9114e54b284f671bb7177b24fb4959679c6afc78
parent90fc7b3ce0ee24c08b1edd40c528467939ef9d4f
libstdc++: Implement ranges [specialized.algorithms]

This implements all the ranges members defined in [specialized.algorithms]:

  ranges::uninitialized_default_construct
  ranges::uninitialized_value_construct
  ranges::uninitialized_copy
  ranges::uninitialized_copy_n
  ranges::uninitialized_move
  ranges::uninitialized_move_n
  ranges::uninitialized_fill
  ranges::uninitialized_fill_n
  ranges::construct_at
  ranges::destroy_at
  ranges::destroy

It also implements (hopefully correctly) the "obvious" optimizations for these
algos, namely that if the output range has a trivial value type and if the
appropriate operation won't throw then we can dispatch to the standard ranges
version of the algorithm which will then potentially enable further
optimizations.

libstdc++-v3/ChangeLog:

* include/Makefile.am: Add <bits/ranges_uninitialized.h>.
* include/Makefile.in: Regenerate.
* include/bits/ranges_uninitialized.h: New header.
* include/std/memory: Include it.
* testsuite/20_util/specialized_algorithms/destroy/constrained.cc: New
test.
* .../uninitialized_copy/constrained.cc: New test.
* .../uninitialized_default_construct/constrained.cc: New test.
* .../uninitialized_fill/constrained.cc: New test.
* .../uninitialized_move/constrained.cc: New test.
* .../uninitialized_value_construct/constrained.cc: New test.
libstdc++-v3/ChangeLog
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/ranges_uninitialized.h [new file with mode: 0644]
libstdc++-v3/include/std/memory
libstdc++-v3/testsuite/20_util/specialized_algorithms/destroy/constrained.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/constrained.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constrained.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/constrained.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_move/constrained.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constrained.cc [new file with mode: 0644]