Chris C wrote:
> Hi,
>
[quoted text clipped - 14 lines]
> In C# there exist the is-operator that clearly makes a distinction.
> Is there a C++ - version of the is-operator ?
Here's a small sample:
#using <mscorlib.dll>
using namespace System;
void test(String^ name, Object^ obj)
{
Console::Write("{0}: ",name);
if (obj->GetType() == Boolean::typeid)
Console::WriteLine("Yes");
else
Console::WriteLine("No");
}
int main()
{
test("double",1.0);
test("bool",true);
test("int",5);
}
-cd
cmrchs@yahoo.com - 05 Jul 2005 18:01 GMT
thanks, I'll try that !
using dynamic_cast<> works as well of course (= standard C++)
greetz
Chris