error C2440: 'type cast' : cannot convert from 'std::stringstream' to 'void *'
- From: mathieu.malaterre@xxxxxxxxx
- Date: 18 Aug 2006 14:00:56 -0700
Hello,
I don't understand why I cannot do the following with vs7:
-----------------------------------
#include <iostream>
#include <sstream>
int main ()
{
std::stringstream ss;
if ( (void*)ss == 0) {
std::cerr << "zero\n";
}
return 0;
}
-----------------------------------
The compiler is returning:
ss.cxx(7) : error C2440: 'type cast' : cannot convert from
'std::stringstream' to 'void *'
Ambiguous user-defined-conversion
But stringstream should inherit this from its parent ios, right ?
http://cplusplus.com/ref/iostream/ios/operatorvoidpt.html
Thanks
Mathieu
.
- Follow-Ups:
- Re: error C2440: 'type cast' : cannot convert from 'std::stringstream' to 'void *'
- From: Igor Tandetnik
- Re: error C2440: 'type cast' : cannot convert from 'std::stringstream' to 'void *'
- Prev by Date: Re: STL Slow - VS2005
- Next by Date: Re: error C2440: 'type cast' : cannot convert from 'std::stringstream' to 'void *'
- Previous by thread: Re: STL Slow - VS2005
- Next by thread: Re: error C2440: 'type cast' : cannot convert from 'std::stringstream' to 'void *'
- Index(es):
Relevant Pages
|