MCPcopy Create free account
hub / github.com/MyGUI/mygui / castType

Function castType

MyGUIEngine/include/MyGUI_Any.h:85–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84 template<typename ValueType>
85 ValueType* castType(bool _throw = true) const
86 {
87 if (this->getType() == typeid(ValueType))
88 return &static_cast<Any::Holder<ValueType>*>(this->mContent.get())->held;
89 MYGUI_ASSERT(
90 !_throw,
91 "Bad cast from type '" << getType().name() << "' to '" << typeid(ValueType).name() << "'");
92 return nullptr;
93 }
94
95 bool compare(const Any& other) const;
96

Callers

nothing calls this directly

Calls 3

getTypeMethod · 0.45
getMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected