Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-03-04 23:55:47


James Hughes <JHughes_at_[hidden]> writes:

> Hello all,
>
> I am pretty sure I am not getting something conceptually here, but can
> anyone shed some light please.
>
> I am writing a template class which contains a std::list of weak_ptr<t1>
>
> template<typename T1>
> class fred
> {
> private :
> typedef boost::weak_ptr<T1> MyPtr;
> typdef std::list<MyPtr> MyPtrList;
>
> MyPtrList MyList;
>
> public :

Return type missing here. void?

> DoSomething()
> {

"typename" missing here.

> MyPtrList::iterator pos;
>
> for (pos = MyList.begin(); pos < MyList.end(); ++pos)
> {
> ...do stuff..
> }
> }
> }
>
> Now that looks fine to me, but the line where I declare the iterator fails
> with a
>
> error: Expect ';' before 'pos'
>
> and I don't know why - it seems fine to me.
>
> Using boost 1.33.1 recent cross compiler to ARM.

HTH,

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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