Sep. 19th, 2005

waider: (Default)
This worked for someone at some point:
deque<T>::iterator iter = container.begin ();
Can someone better versed in C++/STL tell me how to make such a thing work in gcc 4? I've tried various combinations of adding std, adding and removing bits of the object typing at random, separating the declaration from the usage, and googling for "good code" to do the job. Mostly, I seem to be finding documents telling me what a deque is, combined with a few that give the exact format above as the way to use it. For context, this is inside a templated operator function like this:
template <class T> ClassName& operator>>(deque<T>& container)
and the compiler is complaining that it expects a ; before iter which suggests to me that the inline declaration somehow isn't working.

update: It appears that putting typename before the declared type fixes it. I will just shake my head and continue patching rather than passing further comment on this.
waider: (Default)
Door to DART: ~10 mins
DART to Tara Street, walk to Aston Quay: ~35 mins, fare €1.90 (single)
Bus to James' Gate: ~10 mins, fare €0.90

I think I got extraordinarily lucky with the bus (noone wanted to get on or off for the whole length of the quays) and the inter-mode timing (DART arrived within minutes of me getting to the station, bus was waiting at the stop when I reached it and departed within minutes of me getting aboard) but it certainly looks like a viable commute. I walked from the office to the DART on the way home - 30 minutes, roughly - and just to reassure me that not all was sweetness and light, the DART was running slowly due to some problem with a level crossing, meaning the trip home ran a good deal longer (the southbound DART wasn't as fortuitously timed, either).

Profile

waider: (Default)
waider

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819202122
232425262728 29
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 10th, 2026 10:06 am
Powered by Dreamwidth Studios