• 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/mpl/find_if.hpp>
6 #include <boost/mpl/integral_c.hpp>
7 #include <boost/mpl/push_back.hpp>
8 #include <boost/mpl/quote.hpp>
9 #include <boost/mpl/vector.hpp>
10 namespace mpl = boost::mpl;
11 
12 
13 struct is_last {
14     template <typename N>
15     struct apply
16         : mpl::integral_c<bool, N::type::value == <%= input_size %>>
17     { };
18 };
19 
20 using vector = <%= mpl_vector((1..input_size).to_a.map { |n|
21     "mpl::integral_c<int, #{n}>"
22 }) %>;
23 
24 using result = mpl::find_if<vector, is_last>::type;
25 
26 
main()27 int main() { }
28