Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bool to Any... How?

Status
Not open for further replies.

neseidus

Programmer
Sep 1, 2004
41
0
0
CA
Hi

I have a CORBA::Any that I'm using to store a bool. This is what I do: (c++)

bool myBool = false;
CORBA::Any myAny;

myAny <<= myBool;

CORBA::Boolean outVal;

myAny >>= CORBA::Any::to_boolean( outVal )

This isn't working!

Any ideas why?
 
try this:
myAny >>= CORBA::Any::to_boolean( myBool )

Ion Filipski
1c.bmp
 
Compiler catches it, complains that there's no constructor that takes the source type.
 
I got it

CORBA::Any myAny;
CORBA::Boolean corbaBool1;
corbaBool1 = true;

myAny <<= CORBA::Any::from_boolean(corbaBool1);

CORBA::Boolean corbaBool;
if( myAny >>= CORBA::Any::to_boolean(corbaBool) )
{
bool myBool = corbaBool;
cout << myBool;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top