Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-10-07 17:43:07


"Aleksey Gurtovoy" <agurtovoy_at_[hidden]> wrote in message
news:4034600A4760D411B8720001031D84FB0109649D_at_postoffice.office.meta...

Here's what I have now:

[...]
#define BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/apply.hpp>

namespace mpl = boost::mpl;
using mpl::_;

template <typename T>
struct ownership
{
    typedef ownership type;
    struct rebind_;
    BOOST_MPL_AUX_LAMBDA_SUPPORT(1, ownership, (T))
 };

int main()
{
    typedef mpl::lambda<ownership<_> >::type f_;
    mpl::apply<f_, int>::type t;
}

I checked out the latest CVS snapshot, noting that you recently checked
in files, but still no luck with bcc. :( I still get:

    [C++ Error] apply.hpp(55): E2404 Dependent type qualifier
    'ownership<_>' has no member type named 'apply'

In case you aren't aware, there are some oddities with this code. First,
note that I force NO_FULL_LAMBDA. That's because it appears not to
be getting defined for bcc. That appears to be because
NO_TEMPLATE_TEMPLATE_PARAMETERS only gets defined for
VC, when, in fact, bcc's template template support is also flaky, and
probably warrants NO_FULL_LAMBDA (if not for other reasons as well).
I actually preprocessed the source to make sure it isn't getting defined,
and sure enough, it's not.

Second, after taking a look at the expansion of
AUX_LAMBDA_SUPPORT, it looks like it defines a rebind<> template,
so I'm wondering why it also needs rebind_. Third, adding a semicolon
to the end of AUX_LAMBDA_SUPPORT evokes:

    [C++ Error] Unit1.cpp(29): E2321 Declaration does not specify a tag
    or an identifier

from bcc. I guess this suprised me, because I'm used to being able to
specify a semicolon when calling a macro function. I suppose your
example shows no trailing semicolon.

Fourth, you show the declaration of AUX_LAMBDA_SUPPORT as
being out-of-line, and not specifying the template params, when, in fact,
it requires the template parameters (which I learned the hard way!), and
it requires them to be in a tuple (which I also learned the hard way!). I
don't see how it can guess the template parameters or work properly
as an out-of-line expression. I know the lambda part is a work in
progress, but I'd really like to get this code working. ;)

Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk