summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/performance/23_containers
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-09 23:39:16 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-09 23:39:16 +0000
commit6b9cb58c9d5dd86ba30c90784cd430a33afe1609 (patch)
treebdd424a1faf4485407949da30fe1da76b5adad9c /libstdc++-v3/testsuite/performance/23_containers
parentfb6e7e820874292570f2a21ddeeaf3c0d6b64f9a (diff)
downloadgcc-6b9cb58c9d5dd86ba30c90784cd430a33afe1609.tar.gz
2006-08-09 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_bvector.h (vector<bool>::_M_copy_aligned): New. (vector<bool>::vector(const vector&), operator=(const vector&), reserve(size_type), _M_fill_insert(iterator, size_type, bool), _M_insert_range(iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag), _M_insert_aux(iterator, bool)): Use it. * testsuite/performance/23_containers/copy_construct/ vector_bool.cc: New. * testsuite/23_containers/vector/bool/cons/1.cc: New. * testsuite/23_containers/vector/bool/cons/2.cc: Likewise. * include/bits/stl_bvector.h (vector<bool>::_M_fill): Remove. (fill(_Bit_iterator, _Bit_iterator, const bool&)): New. (vector<bool>::_M_fill_insert(iterator, size_type, bool)): Adjust. * include/bits/stl_bvector.h (_M_initialize_range(_InputIterator, _InputIterator, std::input_iterator_tag)): Remove redundant assignments. * include/bits/stl_algo.h (find(istreambuf_iterator<>, istreambuf_iterator<>, _CharT)): Adjust signature. * include/bits/streambuf_iterator.h: Likewise. * include/std/std_streambuf.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/performance/23_containers')
-rw-r--r--libstdc++-v3/testsuite/performance/23_containers/copy_construct/vector_bool.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/performance/23_containers/copy_construct/vector_bool.cc b/libstdc++-v3/testsuite/performance/23_containers/copy_construct/vector_bool.cc
new file mode 100644
index 00000000000..43f74a5f2c9
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/23_containers/copy_construct/vector_bool.cc
@@ -0,0 +1,47 @@
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <vector>
+#include <testsuite_performance.h>
+
+int main()
+{
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+
+ start_counters(time, resource);
+ const std::vector<bool> ref(100000);
+
+ for (unsigned i = 0; i < 1000000; ++i)
+ std::vector<bool> v(ref);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
+
+ return 0;
+}