MyGUI: Class Any usage

MyGUI 3.4.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

Class Any usage
void f()
{
// test class, with simple types everything is similar
struct Data { int value; };
// instance and initialization
Data data;
data.value = 0xDEAD;
// copy of class Data will be created
MyGUI::Any any = data;
// copy of class Data
Data copy_data = *any. castType<Data>();
// now value == 0xDEAD
int value = copy_data.value;
// copy of pointer on class Data will be created
any = &data;
// copy of pointer on class Data and on object data
Data* copy_ptr = *any.castType<Data*>();
// now value == 0
copy_ptr->value = 0;
}
MyGUI::Any
Definition MyGUI_Any.h:56
MyGUI::Any::castType
ValueType * castType(bool _throw=true) const
Definition MyGUI_Any.h:90

Any usage