boost::any 学习
2017-06-07 16:36
169 查看
0x01 缘由
阅读源码ise发现此库的用法,于是学习学习,毕竟如果在性能要求不高的情况下,个人是不远造轮子的,而更愿意拿来使用,用好。
0x02 boost::any 简介
0x03 boost::any 用法举例
// class ObjectContext - 从此类继承给对象添加上下文 class ObjectContext { public: void setContext(const boost::any& value) { context_ = value; } const boost::any& getContext() const { return context_; } boost::any& getContext() { return context_; } private: boost::any context_; };
ConnContextPtr connContext = boost::any_cast<ConnContextPtr>(connection->getContext());
0x04 注意事项
1、2、 引用 http://blog.csdn.net/yockie/article/details/47814441
相关文章推荐
- C++学习 boost学习之-any
- boost::any 学习
- Boost学习笔记之any
- 绪章 Boost 学习笔记之一 any
- C++“准”标准库Boost学习指南(6):Boost.Any
- Boost 学习之算法篇 any_of 与 any_of_equal
- boost学习之-any
- C++“准”标准库Boost学习指南(6):Boost.Any
- 用XML来配置属性---用boost::any, TinyXML测试
- Boost源码剖析之:泛型指针类any之海纳百川
- Boost.Python学习笔记
- Boost学习笔记 BOOST_STATIC_ASSERT
- 学习boost之lexical_cast
- 用XML来配置属性---用boost::any, TinyXML测试
- Boost学习笔记 operators
- Boost 库 学习指南
- [转载]Boost源码剖析之:泛型指针类any之海纳百川
- Boost学习笔记之六 深度剖析pool
- Boost::any
- Boost::any分析