[cpp] for_each中delete函数的适配问题

苏亚 su1981ya at 163.com
Wed Dec 6 16:35:44 CST 2006


Chen Shuo 写道:
> 可以玩玩 lambda 表达式啥的。
>
> On 12/6/06, li guojian <guojianlee at gmail.com> wrote:
>> On 12/6/06, 苏亚 <su1981ya at 163.com> wrote:
>> > 语句:
>> > vector<CFuzzyShapeRule<T1>*> m_cpfsPosition;
>> > 。。。。。。
>> > for_each(m_cpfsPosition.begin(),m_cpfsPosition.end(), delete ); //
>> (1) 或者
>> > for_each(m_cpfsPosition.begin(),m_cpfsPosition.end(),ptr_fun( delete )
>> > ); // (2)
>> >
>> > 错误:
>> > no matching function for call to `ptr_fun(<type error>)'
>> >
>> > 这里delete不是一个函数,而是一个语句,所以没有办法适配。 那么请问,
>> 除了
你说得是boost中的lambda吧,还没有用过,不过如果可行的的话值得一试




More information about the Cpp mailing list