Ticket #7565: z.cpp

File z.cpp, 1.1 KB (added by lukeocamden@…, 10 years ago)

Fails with 'icc -DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS -DBOOST_MPL_LIMIT_VECTOR_SIZE=50'

Line 
1#include <boost/mpl/vector_c.hpp>
2#include <boost/mpl/not.hpp>
3#include <boost/mpl/fold.hpp>
4#include <boost/mpl/vector.hpp>
5#include <boost/mpl/copy_if.hpp>
6#include <boost/mpl/contains.hpp>
7#include <boost/mpl/for_each.hpp>
8#include <boost/mpl/transform.hpp>
9#include <boost/type_traits/is_same.hpp>
10#include <iostream>
11
12typedef boost::mpl::vector_c<int,1,2,3,4,5,6,7,8,9,10>::type left;
13typedef boost::mpl::vector_c<int,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70
14#if 1
15,71
16#endif
17>::type right;
18
19struct join_unique
20{
21 template <class Sequence1,
22 class Sequence2>
23 struct apply
24 {
25 typedef typename boost::mpl::copy_if<
26 Sequence2,
27 boost::mpl::not_<
28 boost::mpl::contains<
29 Sequence1,
30 boost::mpl::placeholders::_1> >,
31 boost::mpl::back_inserter<Sequence1>
32 >::type type;
33 };
34};
35
36typedef typename join_unique::apply<left,right>::type joined;
37
38struct printer {
39 template <typename T>
40 void operator()(const T& val)
41 {
42 std::cout << val << std::endl;
43 }
44};
45
46int main() {
47 boost::mpl::for_each<joined>(printer());
48}
49