/* @copyright Louis Dionne 2014 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 using namespace boost::hana; BOOST_HANA_CONSTEXPR_LAMBDA auto permute = [](auto xs) { return [=](auto ...expected_) { auto actual = permutations(xs); auto expected = list(expected_...); //! @todo //! This is a cheap unordered container membership checking. //! Use a real unordered container instead. BOOST_HANA_STATIC_ASSERT( length(expected) == length(actual) && all([=](auto x) { return elem(x, expected); }, actual) ); }; }; int main() { permute(list_c)(list_c); permute(list_c)(list_c); permute(list_c)( list_c, list_c ); permute(list_c)( list_c, list_c, list_c, list_c, list_c, list_c ); }