// Copyright Louis Dionne 2013-2016 // 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 #include #include namespace hana = boost::hana; // Sample implementation of a compile-time set data structure. Of course, // this naive implementation only works when no two elements of the same // set have the same hash. template struct bucket { }; template struct set : bucket()))::type>... { }; template struct contains : std::is_base_of< bucket()))::type>, Set > { }; using Set = set, hana::ulong<2>, hana::type>; static_assert(contains>{}, ""); static_assert(contains>{}, ""); static_assert(contains>{}, ""); static_assert(!contains>{}, ""); static_assert(!contains>{}, ""); int main() { }