| 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/core/when.hpp> |
| 6 | namespace hana = boost::hana; |
| 7 | |
| 8 | |
| 9 | template <typename T, typename = hana::when<true>> |
| 10 | struct base_template; |
| 11 | |
| 12 | template <typename T> |
| 13 | struct base_template<T, hana::when_valid<typename T::first_type>> { }; |
| 14 | |
| 15 | template <typename T> |
| 16 | struct base_template<T, hana::when_valid<typename T::second_type>> { }; |
| 17 | |
| 18 | struct First { struct first_type; }; |
| 19 | struct Second { struct second_type; }; |
| 20 | |
| 21 | template struct base_template<First>; |
| 22 | template struct base_template<Second>; |
| 23 | |
| 24 | int main() { } |
| 25 | |