boost::polymorphic_strict_get — 从给定的 variant
中检索指定类型的数值。
// In header: <boost/variant/polymorphic_get.hpp> template<typename U, typename T1, typename T2, ..., typename TN> U * polymorphic_strict_get(variant<T1, T2, ..., TN> * operand); template<typename U, typename T1, typename T2, ..., typename TN> const U * polymorphic_strict_get(const variant<T1, T2, ..., TN> * operand); template<typename U, typename T1, typename T2, ..., typename TN> U & polymorphic_strict_get(variant<T1, T2, ..., TN> & operand); template<typename U, typename T1, typename T2, ..., typename TN> const U & polymorphic_strict_get(const variant<T1, T2, ..., TN> & operand);