Boost logo

Boost Users :

Subject: Re: [Boost-users] [lambda] Should the code compile?
From: Max (loadcom_at_[hidden])
Date: 2008-12-31 00:39:00


Hello Watanabe,

It seems to be a problem of my mail editor.
I have used the correct static_cast grammar but some characters were
silently eaten. :-(

Sorry for misleading.

At last, I've found the problem and the working code is as follows:

#define DECLARE_PTR_AUTO_DELETOR_CONDITIONAL(CLASS, VAR_PTR, CONDITION)\
    boost::scoped_ptr<CLASS> auto__deletor__for__ ## VAR_PTR (\
    (boost::lambda::if_then_else_return(boost::lambda::_1, VAR_PTR,\
        static_cast<CLASS*>(0))) (CONDITION))

I should use if_then_else_return instead of if_then_else.

Thanks for help.

B/Rgds
Max



----- Original Message -----
From: Steven Watanabe <watanabesj_at_[hidden]>
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [lambda] Should the code compile?
Date: 2008-12-31 00:51:01

AMDG

Max wrote:
> I have the following simple code, but doesn't get compiled:
>
> #define DECLARE_PTR_AUTO_DELETOR_CONDITIONAL(CLASS, VAR_PTR, CONDITION)\
> boost::scoped_ptr auto__deletor__for__ ## VAR_PTR (\
> boost::lambda::ret(boost::lambda::if_then_else(_1,\
> VAR_PTR, static_cast(0)))(static_cast(CONDITION)))
>

That's not the correct syntax for static_cast

In Christ,
Steven Watanabe

-------------------------------------------------------------------
ÐÂÀ˿ռ䡪¡ªÓëÅóÓÑ¿ªÐÄ·ÖÏíÍøÂçÐÂÉú»î£¡(http://space.sina.com.cn/ )


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