Boost logo

Boost Users :

Subject: [Boost-users] [Proto] Nested Types in Transforms
From: Hossein Haeri (powerprogman_at_[hidden])
Date: 2011-02-15 19:04:57


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<>::type:

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)
>::type
>
>
{};

For an expression like x >> f, here, I am trying to make sure that f can be called with the right number of doubles -- that I have accumulated in x.

When I compile this under GCC 4.5.1 (MinGW32, WinXP, SP3) and Boost 1.42, I get the following errors:

In file included from main.cpp:5:0:
EmtnGram.hpp:141:4: error: incomplete type 'arity_caller::CanBeCalled<boost::proto::_value(boost::proto::_child_c<1>), EmtnTermOrGram(boost::proto::_child_c<0>)>' used in nested name specifier
EmtnGram.hpp:141:4: error: incomplete type 'arity_caller::CanBeCalled<boost::proto::_value(boost::proto::_child_c<1>), EmtnTermOrGram(boost::proto::_child_c<0>)>' used in nested name specifier
EmtnGram.hpp:146:3: error: template argument 1 is invalid
EmtnGram.hpp:147:2: error: template argument 2 is invalid

Do I get it correctly that it's the ::type part of CanBeCalled<>::type that is confusing the compiler? Why is that happening? And, what's the cure?

TIA,
--Hossein


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