when.cpp 682 B

123456789101112131415161718192021222324
  1. // Copyright Louis Dionne 2013-2017
  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. #include <boost/hana/core/when.hpp>
  5. namespace hana = boost::hana;
  6. template <typename T, typename = hana::when<true>>
  7. struct base_template;
  8. template <typename T>
  9. struct base_template<T, hana::when_valid<typename T::first_type>> { };
  10. template <typename T>
  11. struct base_template<T, hana::when_valid<typename T::second_type>> { };
  12. struct First { struct first_type; };
  13. struct Second { struct second_type; };
  14. template struct base_template<First>;
  15. template struct base_template<Second>;
  16. int main() { }