R
Rex
Hi,
I have this sample code:
/* === code begin === */
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 }
/*==== code end ===*/
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?
Thanks
Rex
I have this sample code:
/* === code begin === */
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 }
/*==== code end ===*/
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?
Thanks
Rex