Logo Search packages:      
Sourcecode: poco version File versions  Download package

template<typename ValueType >
ValueType* AnyCast ( Any operand) [friend]

AnyCast operator used to extract the ValueType from an Any*. Will return a pointer to the stored value.

Example Usage: MyType* pTmp = AnyCast<MyType*>(pAny). Will return NULL if the cast fails, i.e. types don't match.

Definition at line 172 of file Any.h.

    return operand && operand->type() == typeid(ValueType)
                ? &static_cast<Any::Holder<ValueType>*>(operand->_content)->_held
                : 0;

Generated by  Doxygen 1.6.0   Back to index