Thread overview
templates: illigal operand types
Aug 03, 2002
Robert M. Münch
Aug 03, 2002
user
Aug 04, 2002
Robert M. Münch
Aug 05, 2002
user
Aug 04, 2002
Walter
August 03, 2002
Hi, while still trying to compile my dtsearch stuff I get:

d:\develop\dtsearch\include\darray.h(185) : Error: illegal operand types
Had: CUserThesaurusItem
and: CUserThesaurusItem
d:\develop\dtsearch\include\darray.h(249) : Error: illegal operand types
Had: CUserThesaurusItem
and: const CUserThesaurusItem
d:\develop\dtsearch\include\darray.h(289) : Error: illegal operand types
Had: CUserThesaurusItem
and: const CUserThesaurusItem
d:\develop\dtsearch\include\darray.h(185) : Error: illegal operand types
Had: CXmlSearchResultsItem
and: CXmlSearchResultsItem
d:\develop\dtsearch\include\darray.h(249) : Error: illegal operand types

Well, for the first error I don't understand what the problem is: both types are the same...

--
Robert M. Münch
IT & Management Freelancer
Mobile: +49 (0)177 2452 802
Fax   : +49 (0)721 8408 9112
Web   : http://www.robertmuench.de



August 03, 2002
Robert M. Münch wrote:
> Hi, while still trying to compile my dtsearch stuff I get:
> 
> d:\develop\dtsearch\include\darray.h(185) : Error: illegal operand types
> Had: CUserThesaurusItem
> and: CUserThesaurusItem
> d:\develop\dtsearch\include\darray.h(249) : Error: illegal operand types
> Had: CUserThesaurusItem
> and: const CUserThesaurusItem
> d:\develop\dtsearch\include\darray.h(289) : Error: illegal operand types
> Had: CUserThesaurusItem
> and: const CUserThesaurusItem
> d:\develop\dtsearch\include\darray.h(185) : Error: illegal operand types
> Had: CXmlSearchResultsItem
> and: CXmlSearchResultsItem
> d:\develop\dtsearch\include\darray.h(249) : Error: illegal operand types
> 
> Well, for the first error I don't understand what the problem is: both types
> are the same...

This is not necessarily true:
...
 vector <int>  a;
 vector <int>  b;
...

a and b are distinct types

to make them the same types:

...
typedef vector <int> int_vector;

int_vector a;
int_vector b;
...

> 
> --
> Robert M. Münch
> IT & Management Freelancer
> Mobile: +49 (0)177 2452 802
> Fax   : +49 (0)721 8408 9112
> Web   : http://www.robertmuench.de
> 
> 
> 

August 04, 2002
<user@domain.invalid> schrieb im Newsbeitrag news:aigihq$2chv$1@digitaldaemon.com...

> This is not necessarily true:
> ...
>   vector <int>  a;
>   vector <int>  b;
> ...
>
> a and b are distinct types

Hi, really? Why this? I thought template instantiation for basic types will only be done once, so using vector<int> serveral times will only instantiate one vector<int> implementation type. Why are these two declarations are of distinct type? Robert


August 04, 2002
That can happen if the compiler can't find an operator overload that fits the argument types you have.

"Robert M. Münch" <robert.muench@robertmuench.de> wrote in message news:aighsg$2bls$1@digitaldaemon.com...
> Well, for the first error I don't understand what the problem is: both
types
> are the same...



August 05, 2002
Robert M. Münch wrote:
> <user@domain.invalid> schrieb im Newsbeitrag
> news:aigihq$2chv$1@digitaldaemon.com...
> 
> 
>>This is not necessarily true:
>>...
>>  vector <int>  a;
>>  vector <int>  b;
>>...
>>
>>a and b are distinct types
> 
> 
> Hi, really? Why this? I thought template instantiation for basic types will
> only be done once, so using vector<int> serveral times will only instantiate
> one vector<int> implementation type.

That's right as far is I know.

 Why are these two declarations are of
> distinct type? Robert
> 
> 

Ignore me, I don't know what I was smoking when I wrote this.