![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
boost
Elihuss
闲来无事码码字!
展开
-
boost 字符类型转换boost::convert使用笔记
boost 字符类型转换一般都是用lexical_cast,还有一种转换方式是使用convert。其实convert只是封装了一个框架,不负责具体类型转换业务,而lexical_cast就可以为convert使用。convert使用范例:#include <iostream>#include <string> #include <boost/convert.hpp>#include <boost/convert/lexical_cast.hpp&g原创 2020-12-24 12:27:34 · 1469 阅读 · 1 评论 -
调用boost的acceptor出现‘already open’异常问题
在使用boost::asio::ip::tcp::acceptor开发HTTP服务端的时候切换了下端口,发现在handle accept的时候老出现already open异常,我明明已经调用了acceptor的close接口了,这是为啥?通过分析日志发现是由于异步handle accept在acceptor close的时候没有立马调用,而是紧接着调用了open和bind,如果此时不使用boost::asio::ip::tcp::acceptor::reuse_address(true),则会立即收到原创 2020-10-13 15:55:38 · 955 阅读 · 0 评论 -
boost教程网址
boost教程:http://zh.highscore.de/cpp/boost/转载 2015-06-02 13:36:31 · 415 阅读 · 0 评论 -
解决cygwin上编译boost for android 的thread库找不到"process.h"
在cygwin上编译boost for android 时总是提示 ”fatal error: process.h: No such file or directory“ 仔细看会发现编译thread库时有进入一个win32的目录,当时我就觉得这儿应该有点问题,可是一直找不到方法解决,后来分析libs\thread\build\Jamfile.v2时发现这样一个东东:local rule原创 2015-06-02 13:09:25 · 1450 阅读 · 0 评论 -
boost日期格式互转和time_t互转
boost日期库虽然强大,使用起来不太方便,在此记录下日期转换代码。boost日期格式转换代码如下: bool FromString(boost::posix_time::ptime& pt, std::string datetime, std::string format){ std::stringstream ss(datetime); //std::loc...原创 2018-09-12 11:49:40 · 4034 阅读 · 0 评论 -
c++ 基于boost序列化XML 和 Properties文件
与ajson库用法类似Example:struct examle_struct{ int _property_int; std::string _property_str; std::string value_str; bool value_bool; int...原创 2018-09-12 12:06:02 · 1591 阅读 · 2 评论 -
boost::io_service 在windows平台调用崩溃解决版本
接手其他同事项目,里面有个这样的定时器,编译没问题,一执行就崩毁在win_mutex lock里面。boost::asio::steady_timer m_CheckTimer{IOServiceManager->GetIOService()};这个问题主要是因为传递io_service 对象到非定义对象之外使用时出现(喜欢使用io_service_pool这类封装的人要注意啦)...原创 2019-03-28 18:01:03 · 780 阅读 · 0 评论 -
c++ 实现华为云对象存储上传数据
目的:方便某些不能使用官方SDK的地方。代码:#pragma once#include <vector>#include <string>#include <curl/curl.h>#include <curl/easy.h>#include <boost/thread.hpp>//Access Key ID#d...原创 2019-08-27 14:31:36 · 1628 阅读 · 0 评论