【Boost】基于boost::lexical_cast的to_string函数
来源:互联网 发布:ubuntu 优麒麟区别 编辑:程序博客网 时间:2024/05/19 18:48
#include <iostream>#include <string>#include "boost/lexical_cast.hpp"template <typename T> std::string to_string(const T& arg) {try {return boost::lexical_cast<std::string>(arg);}catch(boost::bad_lexical_cast& e) {return "";}}int main() {std::string s = to_string(412);std::cout << s << std::endl;s = to_string(2.357);std::cout << s << std::endl;}
- 【Boost】基于boost::lexical_cast的to_string函数
- Boost的转换函数numeric_cast和lexical_cast
- boost::lexical_cast 的使用
- Boost::Lexical_cast 的使用
- Boost::Lexical_Cast的使用
- Boost::lexical_cast
- Boost :Lexical_cast
- boost::lexical_cast
- boost lexical_cast
- boost::lexical_cast
- boost lexical_cast
- boost::lexical_cast
- BOOST-lexical_cast
- 【转载】boost::lexical_cast 的使用
- boost::lexical_cast库的使用
- Boost的万能转换器-->lexical_cast
- boost/lexical_cast.hpp的简单使用方法
- boost/lexical_cast.hpp的简单使用方法
- 布局篇-Grid布局
- DIY经验谈 家中云存储组建NAS经验谈
- java 操作 MongoDB 快速入手
- SQLyog中文乱码的解决方法
- How to enable directory listing in tomcat
- 【Boost】基于boost::lexical_cast的to_string函数
- MySQL与MongoDB的操作对比
- error PRJ0019: A tool returned an error code from "Performing Post-Build Event..." 解决方法
- 名词-简称-扫盲
- java.lang.UnsupportedClassVersionError: Bad version number in .class file解决办法
- MongoDB 基础java数据类型
- 最小生成树
- 关于php学习笔记三
- 动态库示例