• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 #include <boost/hana/equal.hpp>
6 #include <boost/hana/front.hpp>
7 #include <boost/hana/integral_constant.hpp>
8 #include <boost/hana/type.hpp>
9 
10 #include <boost/mpl/size.hpp>
11 #include <boost/mpl/vector.hpp>
12 namespace hana = boost::hana;
13 namespace mpl = boost::mpl;
14 
15 
16 //! [front]
17 #include <boost/hana/ext/boost/mpl/vector.hpp> // bridge header
18 
19 using Vector = mpl::vector<int, char, float>;
20 static_assert(hana::front(Vector{}) == hana::type_c<int>, "");
21 //! [front]
22 
23 
24 namespace _ns0 {
25 //! [size]
26 using Size = mpl::size<Vector>::type;
27 static_assert(hana::equal(Size{}, hana::int_c<3>), ""); // breaks!
28 //! [size]
29 }
30 
31 
32 //! [size-fixed]
33 #include <boost/hana/ext/boost/mpl/integral_c.hpp>
34 
35 using Size = mpl::size<Vector>::type;
36 static_assert(hana::equal(Size{}, hana::int_c<3>), "");
37 //! [size-fixed]
38 
39 
main()40 int main() { }
41