1 // Copyright (C) 2018-2022 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do compile { target c++17 } }
19 // { dg-require-effective-target hosted }
26 using std::boyer_moore_searcher
;
27 using std::boyer_moore_horspool_searcher
;
35 constexpr auto expected
= sizeof(boyer_moore_searcher
<const char*>);
36 static_assert(sizeof(boyer_moore_searcher
<const long*>) != expected
);
37 using T1
= boyer_moore_searcher
<char*, hash
<char>, equal_to
<char>>;
38 static_assert(sizeof(T1
) == expected
);
39 using T2
= boyer_moore_searcher
<byte
*>;
40 static_assert(sizeof(T2
) == expected
);
41 using T3
= boyer_moore_searcher
<const byte
*>;
42 static_assert(sizeof(T3
) == expected
);
43 using T4
= boyer_moore_searcher
<const byte
*, hash
<byte
>, equal_to
<byte
>>;
44 static_assert(sizeof(T4
) == expected
);
50 constexpr auto expected
= sizeof(boyer_moore_horspool_searcher
<const char*>);
51 static_assert(sizeof(boyer_moore_horspool_searcher
<const long*>) != expected
);
52 using T1
= boyer_moore_horspool_searcher
<char*, hash
<char>, equal_to
<char>>;
53 static_assert(sizeof(T1
) == expected
);
54 using T2
= boyer_moore_horspool_searcher
<byte
*>;
55 static_assert(sizeof(T2
) == expected
);
56 using T3
= boyer_moore_horspool_searcher
<const byte
*>;
57 static_assert(sizeof(T3
) == expected
);
59 = boyer_moore_horspool_searcher
<const byte
*, hash
<byte
>, equal_to
<byte
>>;
60 static_assert(sizeof(T4
) == expected
);