1// Copyright Louis Dionne 2013-2022
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
4
5#include <boost/hana/type.hpp>
6namespace hana = boost::hana;
7
8
9template <bool b = false>
10struct invalid { static_assert(b, "invalid must not be instantiated"); };
11
12template <typename T> void adl(T) { }
13template <typename T> void adl_pattern(hana::basic_type<T>) { }
14
15
16int main() {
17 // ADL kicks in but `invalid<>` must not instantiated
18 adl(hana::type_c<invalid<>>);
19 adl_pattern(hana::type_c<invalid<>>);
20
21 // ADL instantiates the types recursively, make sure that works too
22 adl(hana::typeid_(hana::type_c<invalid<>>));
23 adl_pattern(hana::typeid_(hana::type_c<invalid<>>));
24}
25

source code of boost/libs/hana/test/type/adl.cpp