Boost logo

Boost Users :

From: James Hughes (JHughes_at_[hidden])
Date: 2006-04-25 10:05:02


Hello all,

I am a bit stumped by a compile fault..

This is a fragment of the code

template<typename T>
void LCLogSource<T>::SetLoggers(std::map<T,
boost::shared_ptr<LCLogHandler<T> > > &LogMap)
{
        typedef std::map<T, boost::shared_ptr<LCLogHandler<T> > >
handlerMap ;
        
        for (handlerMap::iterator pos = LogMap.begin(); pos != LogMap.end();
++pos) // **** compile error here
        {

yada yada

I get a compile fault on the for line, 'expected ; before pos'.

Now this fault has only started happening since I decided to template this
class. It appears that the combination of the template, and the complexity
of the map declaration is causing things to go awry, and I don't know why. I
have tried a few alternatives but always get a problem of some description.

Is there some reason I cannot use iterators on a stl::map where the map key
defn. depends on the template parameter?

In case this is nothing to do with the shared_ptr in the map, does anyone
have a list where templates programming is discussed so I can post there?

James


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