| 1 |
// -*- C++ -*- |
| 2 |
|
| 3 |
// Copyright (C) 2005-2025 Free Software Foundation, Inc. |
| 4 |
// |
| 5 |
// This file is part of the GNU ISO C++ Library. This library is free |
| 6 |
// software; you can redistribute it and/or modify it under the terms |
| 7 |
// of the GNU General Public License as published by the Free Software |
| 8 |
// Foundation; either version 3, or (at your option) any later |
| 9 |
// version. |
| 10 |
|
| 11 |
// This library is distributed in the hope that it will be useful, but |
| 12 |
// WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
// General Public License for more details. |
| 15 |
|
| 16 |
// You should have received a copy of the GNU General Public License |
| 17 |
// along with this library; see the file COPYING3. If not see |
| 18 |
// <http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
|
| 21 |
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. |
| 22 |
|
| 23 |
// Permission to use, copy, modify, sell, and distribute this software |
| 24 |
// is hereby granted without fee, provided that the above copyright |
| 25 |
// notice appears in all copies, and that both that copyright notice |
| 26 |
// and this permission notice appear in supporting documentation. None |
| 27 |
// of the above authors, nor IBM Haifa Research Laboratories, make any |
| 28 |
// representation about the suitability of this software for any |
| 29 |
// purpose. It is provided "as is" without express or implied |
| 30 |
// warranty. |
| 31 |
|
| 32 |
/** |
| 33 |
* @file node_update_trait.hpp |
| 34 |
* Contains traits for a random regression test |
| 35 |
* for a specific container type. |
| 36 |
*/ |
| 37 |
|
| 38 |
#ifndef PB_DS_REGRESSION_TEST_NODE_UPDATOR_TRAIT_HPP |
| 39 |
#define PB_DS_REGRESSION_TEST_NODE_UPDATOR_TRAIT_HPP |
| 40 |
|
| 41 |
#include <ext/pb_ds/assoc_container.hpp> |
| 42 |
#include <common_type/assoc/detail/tree_supports_order_statistics.hpp> |
| 43 |
#include <common_type/assoc/detail/trie_supports_order_statistics.hpp> |
| 44 |
#include <common_type/assoc/detail/trie_supports_prefix_search.hpp> |
| 45 |
|
| 46 |
namespace __gnu_pbds |
| 47 |
{ |
| 48 |
|
| 49 |
namespace test |
| 50 |
{ |
| 51 |
|
| 52 |
namespace detail |
| 53 |
{ |
| 54 |
|
| 55 |
template<typename Cntnr, class Tag> |
| 56 |
struct regression_test_node_update_traits |
| 57 |
{ |
| 58 |
enum |
| 59 |
{ |
| 60 |
order_statistics = false, |
| 61 |
prefix_search = false |
| 62 |
}; |
| 63 |
}; |
| 64 |
|
| 65 |
template<typename Cntnr> |
| 66 |
struct regression_test_node_update_traits< |
| 67 |
Cntnr, |
| 68 |
__gnu_pbds::pat_trie_tag> |
| 69 |
{ |
| 70 |
enum |
| 71 |
{ |
| 72 |
order_statistics = |
| 73 |
trie_supports_order_statistics<Cntnr>::value, |
| 74 |
prefix_search = |
| 75 |
trie_supports_prefix_search<Cntnr>::value |
| 76 |
}; |
| 77 |
}; |
| 78 |
|
| 79 |
template<typename Cntnr> |
| 80 |
struct regression_test_node_update_traits< |
| 81 |
Cntnr, |
| 82 |
__gnu_pbds::rb_tree_tag> |
| 83 |
{ |
| 84 |
enum |
| 85 |
{ |
| 86 |
order_statistics = |
| 87 |
tree_supports_order_statistics<Cntnr>::value, |
| 88 |
prefix_search = false |
| 89 |
}; |
| 90 |
}; |
| 91 |
|
| 92 |
template<typename Cntnr> |
| 93 |
struct regression_test_node_update_traits< |
| 94 |
Cntnr, |
| 95 |
__gnu_pbds::splay_tree_tag> |
| 96 |
{ |
| 97 |
enum |
| 98 |
{ |
| 99 |
order_statistics = |
| 100 |
tree_supports_order_statistics<Cntnr>::value, |
| 101 |
prefix_search = false |
| 102 |
}; |
| 103 |
}; |
| 104 |
|
| 105 |
template<typename Cntnr> |
| 106 |
struct regression_test_node_update_traits< |
| 107 |
Cntnr, |
| 108 |
__gnu_pbds::ov_tree_tag> |
| 109 |
{ |
| 110 |
enum |
| 111 |
{ |
| 112 |
order_statistics = |
| 113 |
tree_supports_order_statistics<Cntnr>::value, |
| 114 |
prefix_search = false |
| 115 |
}; |
| 116 |
}; |
| 117 |
|
| 118 |
} // namespace detail |
| 119 |
|
| 120 |
} // namespace test |
| 121 |
|
| 122 |
} // namespace __gnu_pbds |
| 123 |
|
| 124 |
#endif // #ifndef PB_DS_REGRESSION_TEST_NODE_UPDATOR_TRAIT_HPP |