From: Benjamin Kosnik Date: Tue, 27 Jun 2006 19:20:06 +0000 (+0000) Subject: typelist.h (typelist_append): To append_typelist. X-Git-Tag: releases/gcc-4.2.0~2258 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cad367a62b3532869209dd3058215eb72b923770;p=thirdparty%2Fgcc.git typelist.h (typelist_append): To append_typelist. 2006-06-27 Benjamin Kosnik * include/ext/typelist.h (typelist_append): To append_typelist. (typelist): To node. Enclose in namespace typelist. * testsuite/util/testsuite_common_types.h: Adjust names, namespaces. * testsuite/performance/23_containers/find/map.cc: Same. * testsuite/performance/23_containers/create/map.cc: Same. * testsuite/performance/23_containers/insert_erase/associative.cc: Same. * testsuite/performance/23_containers/insert/sequence.cc: Same. * testsuite/performance/23_containers/insert/associative.cc: Same. * testsuite/performance/23_containers/create_from_sorted/set.cc: Same. * testsuite/performance/23_containers/index/map.cc: Same. * testsuite/performance/23_containers/insert_from_sorted/set.cc: Same. * testsuite/performance/23_containers/create_sort/list.cc: Same. * testsuite/performance/23_containers/sort_search/list.cc: Same. * testsuite/performance/23_containers/producer_consumer/sequence.cc: Same. * testsuite/performance/23_containers/producer_consumer/associative.cc: Same. From-SVN: r115037 --- diff --git a/libstdc++-v3/include/ext/typelist.h b/libstdc++-v3/include/ext/typelist.h index 143efc02cdf4..11913e3aa222 100644 --- a/libstdc++-v3/include/ext/typelist.h +++ b/libstdc++-v3/include/ext/typelist.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2005, 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 @@ -48,13 +48,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - // XXX namespace typelist - // struct typelist -> struct node - +namespace typelist +{ struct null_type { }; template - struct typelist + struct node { typedef Root root; }; @@ -71,7 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) struct append; template - struct typelist_append; + struct append_typelist; template struct contains; @@ -87,12 +86,15 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) template class Transform> struct transform; +} // namespace typelist _GLIBCXX_END_NAMESPACE _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace typelist +{ namespace detail { // #include @@ -245,32 +247,35 @@ namespace detail typedef chain type; }; - // #include + // #include template - struct typelist_append_; + struct append_typelist_; template - struct typelist_append_ > + struct append_typelist_ > { typedef chain type; }; template - struct typelist_append_ > + struct append_typelist_ > { private: - typedef typename typelist_append_::type rest; + typedef typename append_typelist_::type rest; public: - typedef typename append >::type::root type; + typedef typename append >::type::root type; }; } // namespace detail +} // namespace typelist _GLIBCXX_END_NAMESPACE _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) +namespace typelist +{ template struct apply { @@ -292,18 +297,18 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) typedef detail::append_ append_type; public: - typedef typelist type; + typedef node type; }; template - struct typelist_append + struct append_typelist { private: typedef typename Typelist_Typelist::root root_type; - typedef detail::typelist_append_ append_type; + typedef detail::append_typelist_ append_type; public: - typedef typelist type; + typedef node type; }; template @@ -325,7 +330,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) typedef detail::chain_filter_ filter_type; public: - typedef typelist type; + typedef node type; }; template @@ -345,27 +350,27 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) typedef detail::chain_transform_ transform_type; public: - typedef typelist type; + typedef node type; }; - +} // namespace typelist _GLIBCXX_END_NAMESPACE -#define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN3(X0, X1, X2) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN4(X0, X1, X2, X3) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::chain -#define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::chain +#define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN3(X0, X1, X2) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN4(X0, X1, X2, X3) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain #endif diff --git a/libstdc++-v3/testsuite/performance/23_containers/create/map.cc b/libstdc++-v3/testsuite/performance/23_containers/create/map.cc index baaf5805becd..08009ec7f48b 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/create/map.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/create/map.cc @@ -1,6 +1,6 @@ // 2003-03-01 gp dot bolton at computer dot org -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -54,7 +54,7 @@ main() typedef test_sequence test_type; test_type test("create"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc b/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc index e7aa60331051..0c6bd709cb21 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -64,7 +64,7 @@ main() typedef test_sequence test_type; test_type test("create_from_sorted"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc b/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc index cd43f0ddc841..02b25cde17fb 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -57,7 +57,7 @@ main() typedef test_sequence test_type; test_type test("create_sort"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/find/map.cc b/libstdc++-v3/testsuite/performance/23_containers/find/map.cc index d63501afeb33..f11bda1c8e28 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/find/map.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/find/map.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 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 @@ -60,7 +60,7 @@ main() typedef test_sequence test_type; test_type test("find"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/index/map.cc b/libstdc++-v3/testsuite/performance/23_containers/index/map.cc index 7705e53ab585..8682c9070d58 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/index/map.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/index/map.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -63,7 +63,7 @@ main() typedef test_sequence test_type; test_type test("index_associative"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc b/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc index 6228a031d98d..8be68f6c1ca8 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -65,7 +65,7 @@ main() typedef test_sequence test_type; test_type test("insert_associative"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc b/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc index 15238ded5385..b6cdbf117def 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -61,7 +61,7 @@ main() typedef test_sequence test_type; test_type test("insert_sequence"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc b/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc index a13fcfab03e0..c0ce6f9aa453 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -68,7 +68,7 @@ main() typedef test_sequence test_type; test_type test("insert_erase_associative"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc b/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc index c02b636686c7..863c7a6dc7c2 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -81,7 +81,7 @@ main() typedef test_sequence test_type; test_type test("insert_from_sorted"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc index 82fab43e0bbb..3ccfca92e691 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -246,11 +246,11 @@ main() typedef __gnu_test::maps::type map_typelist; typedef __gnu_test::sets::type set_typelist; - typedef __gnu_cxx::append::type container_types; + typedef __gnu_cxx::typelist::append::type container_types; typedef test_sequence test_type; test_type test("producer_consumer_associative"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc index 5e71a6a588de..4adccb94654a 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -249,7 +249,7 @@ main() typedef test_sequence test_type; test_type test("producer_consumer_sequence"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc b/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc index 7adea2bf1e79..ed48eb9412f8 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 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 @@ -76,7 +76,7 @@ main() typedef test_sequence test_type; test_type test("sort_search"); - __gnu_cxx::apply applier; + __gnu_cxx::typelist::apply applier; applier(test); return 0; diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index e63f5e0e590c..c4819109b19a 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -54,9 +54,9 @@ namespace __gnu_test { - using __gnu_cxx::typelist; - using __gnu_cxx::transform; - using __gnu_cxx::append; + using __gnu_cxx::typelist::node; + using __gnu_cxx::typelist::transform; + using __gnu_cxx::typelist::append; // All the allocators to test. template @@ -69,7 +69,7 @@ namespace __gnu_test typedef __gnu_cxx::__mt_alloc a3; typedef __gnu_cxx::bitmap_allocator a4; typedef __gnu_cxx::__pool_alloc a5; - typedef typelist<_GLIBCXX_TYPELIST_CHAIN5(a1, a2, a3, a4, a5)> type; + typedef node<_GLIBCXX_TYPELIST_CHAIN5(a1, a2, a3, a4, a5)> type; }; // Typelists for vector, string, list, deque. @@ -385,7 +385,7 @@ template template void - operator()(__gnu_cxx::detail::type_to_type) + operator()(__gnu_cxx::typelist::detail::type_to_type) { const int i = 20000; test_container(_M_filename);