// 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 namespace hana = boost::hana; int main() { { typedef std::pair P1; hana::pair p1(3, 4); hana::pair p2 = p1; BOOST_HANA_RUNTIME_CHECK(hana::first(p2) == 3); BOOST_HANA_RUNTIME_CHECK(hana::second(p2) == 4); } static_assert(std::is_trivially_copy_constructible>::value, ""); // make sure it also works constexpr { constexpr hana::pair p1(3, 4); constexpr hana::pair p2 = p1; static_assert(hana::first(p2) == 3, ""); static_assert(hana::second(p2) == 4, ""); } // Make sure it works across pair types (pair -> pair) { hana::pair p1(3, 4); hana::pair p2 = p1; BOOST_HANA_RUNTIME_CHECK(hana::first(p2) == 3); BOOST_HANA_RUNTIME_CHECK(hana::second(p2) == 4); } // And also constexpr across pair types { constexpr hana::pair p1(3, 4); constexpr hana::pair p2 = p1; static_assert(hana::first(p2) == 3, ""); static_assert(hana::second(p2) == 4, ""); } }