You're missing the required typename keyword:
typedef typename container::value_type elementtype;
This is because container
is a dependent name in this template, so the compiler has no way of knowing whether container::value_type is always a type or not, as it may depend on the choice of container
.
Surely this question is a FAQ somewhere?
Edit, it is: http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18
Charles Bailey
2009-04-12 11:02:42