H
Hendrik Schober
Hi,
I have some expression template code that I want to
get to work. I had a typo in it and just spent two
hours to find it, because VC7.1 gave a really weird
error message for it.
This is the code:
template< typename T1, typename TExpr, typename T2>
inline
Detail::CExpression< T2, Detail::CExpression<T1,TExpr> >
operator+( const Detail::CExpression<T1,TExpr>& expr
, const CNamedTypedParameter<T2>& par )
{
return Detail::CExpression< T2, Detail::CExpression<T1,TExpr> >( par, expr );
//return Detail::CExpression< T2, Detail::CExpression<T1,TExpr>( par, expr);
}
The code compiles fine as it is. Uncommenting commented
line (which misses a closing bracket) causes
error C2665: 'Detail::CExpression<T,TExpr>::__ctor' :
none of the 2 overloads can convert parameter 2 from type 'const Detail::CExpression<T,TExpr>'
OK, by the standard, this should be fine. I fed the
compiler none-conforming code and it spit out a
diagnostic. However, it's a very misleading one!
Did anybody else see something like this? Is it worth
spending the time to distill a repro from the code?
Schobi
--
(e-mail address removed) is never read
I'm Schobi at suespammers org
"My hair style calls into immediate question all my judgements."
Scott Meyers
(http://www.google.de/[email protected])
I have some expression template code that I want to
get to work. I had a typo in it and just spent two
hours to find it, because VC7.1 gave a really weird
error message for it.
This is the code:
template< typename T1, typename TExpr, typename T2>
inline
Detail::CExpression< T2, Detail::CExpression<T1,TExpr> >
operator+( const Detail::CExpression<T1,TExpr>& expr
, const CNamedTypedParameter<T2>& par )
{
return Detail::CExpression< T2, Detail::CExpression<T1,TExpr> >( par, expr );
//return Detail::CExpression< T2, Detail::CExpression<T1,TExpr>( par, expr);
}
The code compiles fine as it is. Uncommenting commented
line (which misses a closing bracket) causes
error C2665: 'Detail::CExpression<T,TExpr>::__ctor' :
none of the 2 overloads can convert parameter 2 from type 'const Detail::CExpression<T,TExpr>'
OK, by the standard, this should be fine. I fed the
compiler none-conforming code and it spit out a
diagnostic. However, it's a very misleading one!
Did anybody else see something like this? Is it worth
spending the time to distill a repro from the code?
Schobi
--
(e-mail address removed) is never read
I'm Schobi at suespammers org
"My hair style calls into immediate question all my judgements."
Scott Meyers
(http://www.google.de/[email protected])