On 27 Jul 2011, at 23:30, Stuart Buchanan wrote: > Within the patch is the code below. The (*j)-> just looks ugly. Surely > there's a better way? > > I'm sure those of you who write C++ more regularly than me will > immediately be able to tell me where I'm going wrong!
As noted elsewhere, you can't avoid the double indirection, but you could use foreach (from Boost): TreeBin* bin = NULL; bool found = false; BOOST_FOREACH(bin, randomForest) { if ((bin->texture() == mat->get_tree_texture()) && ... { found = true; break; } } ------------------------------------------------------------------------------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel