Boost logo

Proto :

Subject: [proto] Strange Error in GCC 4.5.1 (MinGW, WinXP, SP3)
From: Hossein Haeri (powerprogman_at_[hidden])
Date: 2011-02-17 14:16:58


Dear all,

In my namespace arity_caller, I have a struct CanBeCalled<> such that CanBeCalled<T, mpl::int_<n> >::type is an mpl::bool_<> representing whether T can be called with n doubles. I also have the following grammar (in a file called 'EmtnGram.hpp') in which I am trying to employ this CanBeCalled<>:

struct EmtnShiftFObjGram:
  boost::proto::and_
  <
    boost::proto::shift_right
    <
      EmtnTermOrGram,
      boost::proto::terminal<boost::proto::_>
>,
    boost::proto::if_
    <
      arity_caller::CanBeCalled
      <
        boost::proto::_value(boost::proto::_right),
        EmtnTermOrGram(boost::proto::_left)
>()
>
>
{};

I have a short test-set that all pass except for the one marked with ***:

struct Plus1
{
  double operator () (double d) const {return d + 1;}
};

struct Plus2
{
  double operator () (double d1, double d2) const {return d1 + d2;}
};

double plus1(double d) {return d + 1;}
double plus2(double d1, double d2) {return d1 + d2;}

int main()
{
  EW1<InpPool, GameState, AmmoMsg>() >> &plus1;
  EW1<InpPool, GameState, AmmoMsg>() >> Plus1();

  (EW1<InpPool, GameState, AmmoMsg>() ||
   EW1<InpPool, GameState, AmmoMsg>()) >> Plus2();//***
  
  (EW1<InpPool, GameState, AmmoMsg>() ||
   EW1<InpPool, GameState, AmmoMsg>()) >> &plus2;

  return 0;
}

When I compile that under GCC 4.5.1 (MinGW32, WinXP, SP3), I get a very long error message. For those nice folks who'd still be interested in seeing it, I have attached that to this posting. Any idea please?

TIA,
--Hossein



Proto list run by eric at boostpro.com