1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: c++98, c++03, c++11, c++14
10
11// <functional>
12
13// boyer_moore_searcher
14
15// Make sure that the implicitly-generated CTAD works.
16
17#include <functional>
18
19#include "test_macros.h"
20
21int main(int, char**) {
22 {
23 char const* str = "hello";
24 std::boyer_moore_searcher searcher(str, str + 3);
25 ASSERT_SAME_TYPE(decltype(searcher), std::boyer_moore_searcher<char const*, std::hash<char>, std::equal_to<>>);
26 }
27 {
28 struct myhash : std::hash<char> { };
29 char const* str = "hello";
30 std::boyer_moore_searcher searcher(str, str + 3, myhash{}, std::not_equal_to<>());
31 ASSERT_SAME_TYPE(decltype(searcher), std::boyer_moore_searcher<char const*, myhash, std::not_equal_to<>>);
32 }
33 {
34 struct myhash : std::hash<char> { };
35 char const* str = "hello";
36 std::boyer_moore_searcher searcher(str, str + 3, myhash{});
37 ASSERT_SAME_TYPE(decltype(searcher), std::boyer_moore_searcher<char const*, myhash, std::equal_to<>>);
38 }
39
40 return 0;
41}
42

source code of libcxx/test/std/utilities/function.objects/func.search/func.search.bm/implicit_ctad.pass.cpp