|
Boost : |
From: Shunsuke Sogame (mb2act_at_[hidden])
Date: 2006-04-29 08:19:06
Alberto Ganesh Barbati wrote:
> Shunsuke Sogame ha scritto:
>
>>I note user workaround:
>>
>> struct xxx : std::vector<int>
>> {
>> void test()
>> {
>> foreach(*this);
>> }
>>
>> template< class SelfT >
>> void foreach(SelfT& self)
>> {
>> BOOST_FOREACH (int x, self) {
>> }
>> }
>> };
>>
>
>
> A much simpler workaround that compiles under VC7.1 is:
>
> struct xxx : std::vector<int>
> {
> void test()
> {
> xxx* This = this;
>
> BOOST_FOREACH(int x, *This)
> {
> }
> }
> };
Doh!
A mysterious reason prevented me from writing even self type...
Bug makes bug. :-)
Thanks again!
-- Shunsuke Sogame
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk