// Copyright Louis Dionne 2013-2017 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include #include #include #include #include namespace hana = boost::hana; namespace with_special_base_class { //! [special_base_class] struct special_base_class { }; template struct print_impl : special_base_class { template static constexpr auto apply(Args&& ...) = delete; }; template struct Printable : hana::integral_constant>>::value > { }; //! [special_base_class] //! [special_base_class_customize] struct Person { std::string name; }; template <> struct print_impl /* don't inherit from special_base_class */ { // ... implementation ... }; static_assert(Printable::value, ""); static_assert(!Printable::value, ""); //! [special_base_class_customize] } namespace actual { //! [actual] template struct print_impl : hana::default_ { template static constexpr auto apply(Args&& ...) = delete; }; template struct Printable : hana::integral_constant>>::value > { }; //! [actual] static_assert(!Printable::value, ""); } int main() { }