Rex
12/16/2008 5:29:00 PM
On Dec 15, 5:46 pm, Ian Collins <ian-n...@hotmail.com> wrote:
> Rex wrote:
>
> > 1 struct Variable {};
> > 2 struct Literal {};
> > 3
> > 4 template <typename ExprT> struct exprTraits { typedef ExprT
> > expr_type; };
> > 5 template <> struct exprTraits<double> { typedef Literal
> > expr_type; };
> > 6 template <> struct exprTraits<int> { typedef Literal expr_type; };
> > 7
> > 8 template <typename ExprT1>
> > 9 struct UnaryExpr {
> > 10 exprTraits<ExprT1>::expr_type expr;
> > 11 };
> > 12
> > 13 int main( void )
> > 14 {
> > 15 return 0;
> > 16 }
>
> > and I got this error when I compile:
>
> > $ g++ -I/usr/include/c++/4.1/bits test.cpp
> > test.cpp:10: error: expected ';' before 'expr'
>
> > Has anyone seen or known about this error?
>
> It looks like you are missing a "typename" before your expression.
>
> Tip: Don't post code with line numbers!
>
> --
> Ian Collins
Sorry for inconvenience. Could you tell me on which line you think I'm
missing typename?
Thanks
Rex