any
类型:类
场景:存放任意类型
使用:boost::any val;
any_cast
注意:any_cast非但不是强转,并且类型必须完全匹配
类型:模板函数
作用:取出any对象中存放的数据
形式:
- ValueType * any_cast(any * operand)
- inline const ValueType * any_cast(const any * operand)
- ValueType any_cast(any & operand)
- inline ValueType any_cast(const any & operand)
失败:
bad_any_cast();
lexical_cast
作用:强转转换,主要用于基本数据类型与string类之间的转换
失败:bad_lexical_cast();
#define _SCL_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <vector>
#include <string>
#include <boost/algorithm/string/split.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/classification.hpp>
#i