Boost logo

Boost Users :

From: John Christopher (jcxxr_at_[hidden])
Date: 2006-05-01 19:33:02

The example at the bottom of:
does not compile; I am using MinGw 3.4.2.

#include <iostream>
#include <boost/fusion/sequence.hpp>
#include <boost/fusion/algorithm.hpp>

using namespace boost::fusion;

struct square
  template <typename T>
  struct result
      typedef int type;

  template <typename T>
  int operator()(T x) const
      return x * x;
typedef vector<int, short, double> vector_type;

int main (int argc, char ** argv)
  vector_type vec(2, 5, 3.3);
  transform_view<vector_type, square> transform(vec, square());
  std::cout << transform << std::endl; //
  return 0;
More specifically it is the line
std::cout << transform << std::endl;
that seems to create the problem.
I was also wondering why operator() of square return int and not T.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at