Boost logo

Boost Users :

From: Edward Diener (eddielee_at_[hidden])
Date: 2004-03-10 21:36:45


fmonkey_at_[hidden] wrote:
> This may be a silly question, but why does the following code give me
> a compile error (only on Linux BTW, not Windows):
>
> template<typename TreeIterT>
> void ClassName::compile_something(const TreeIterT& iter,
> compile_context &ctx)
> {
> const TreeIterT::value_type& ident = get_first_leaf(*iter);
> }

typename const TreeIterT::value_type& ident = get_first_leaf(*iter);

>
> In member function `void ClassName::compile_something(const
> TreeIterT&, CompileContext&)':
> 128: error: syntax error before `&' token
>
> Also:
>
> template<typename TreeNodeT>
> void ClassName::compile_something_else(const TreeNodeT &tree,
> compile_context &ctx)
> {
> TreeNodeT::const_iterator iter = tree.begin();
> }

typename TreeNodeT::const_iterator iter = tree.begin();

>
> In member function `void ClassName::compile_something_else(const
> 138: error: syntax error before `=' token


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