Boost logo

Boost Users :

From: Lucio Flores (dogboy_l_at_[hidden])
Date: 2006-02-23 22:05:10


Just trying to use mpl::transform on a vector of int's and I can't seem to get
it working properly. Can anyone see what's wrong?? I'm trying to perform

vector_c<int, 1, 2, 3> + vector_c<int, 1, 1, 1> = vector_c<int, 2, 3 ,4>

The is_same function always returns false when I compile and run it.

-------------------

typedef mpl::vector_c<int, 1, 2, 3> type_a;
typedef mpl::vector_c<int, 1, 1, 1> type_b;

struct plus_f {
  template<class A, class B>
  struct apply {
    typedef typename mpl::plus<A, B>::type type;
  };
};

typedef mpl::transform<type_a, type_b, plus_f >::type result_type;

std::cerr << "True "
          << boost::is_same<result_type, mpl::vector_c<int, 2, 3, 4> >::value
          << std::endl;

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net