| 214 |
// use typeid() comparison, e.g., when our types may travel across |
// use typeid() comparison, e.g., when our types may travel across |
| 215 |
// different shared libraries. |
// different shared libraries. |
| 216 |
template<typename ValueType> |
template<typename ValueType> |
| 217 |
ValueType * unsafe_any_cast(any * operand) |
inline ValueType * unsafe_any_cast(any * operand) |
| 218 |
{ |
{ |
| 219 |
return &static_cast<any::holder<ValueType> *>(operand->content)->held; |
return &static_cast<any::holder<ValueType> *>(operand->content)->held; |
| 220 |
} |
} |
| 221 |
|
|
| 222 |
template<typename ValueType> |
template<typename ValueType> |
| 223 |
const ValueType * unsafe_any_cast(const any * operand) |
inline const ValueType * unsafe_any_cast(const any * operand) |
| 224 |
{ |
{ |
| 225 |
return any_cast<ValueType>(const_cast<any *>(operand)); |
return unsafe_any_cast<ValueType>(const_cast<any *>(operand)); |
| 226 |
} |
} |
| 227 |
} |
} |
| 228 |
|
|