
boost
seebit
这个作者很懒,什么都没留下…
展开
-
conversion/lexical_cast
<br />1、字符串->数值 <br />C++代码<br />#include <boost/lexical_cast.hpp> <br />#include <iostream> <br />int main() <br />{ <br /> using boost::lexical_cast; <br /> int a = lexical_cast<int>("123"); <br /> double b = lexica转载 2010-12-11 11:07:00 · 727 阅读 · 0 评论 -
boost.thread时间的设置
<br />boost.thread时间一般有两种指定方式:<br />1. 指定超时的时间点<br />boost::xtime xt;<br />boost::xtime_get(&xt, boost::TIME_UTC); // initialize xt with current time<br />xt.nsec += 1000*1000*10; // change xt to next second<br /> boost::thread::sleep(xt); // 休眠10原创 2010-12-13 17:29:00 · 1475 阅读 · 0 评论 -
ASIO deadline_timer 的使用
1. cancel的使用 async_wait设定的handler会被调用, 超时处理函数应该区分 boost::asio::error::operation_aborted2.多次调用async_wait设定多个handler,则超时的时候它们都会被调用,如果将同一个h原创 2011-09-19 10:39:58 · 1772 阅读 · 0 评论 -
boost bind signal
#include #include #include int main(void) { boost::signals2::signal sig; boost::function f = boost::bind(boost::ref(sig), 10); }转载 2011-11-01 18:13:00 · 734 阅读 · 0 评论 -
ubuntu下编译安装boost1.44.0
1. 解压代码到/boost/boost_1_44_02. 生成bjam cd boost_1_44_0/tools/jam/src ./build.sh (如果没有执行权限,需要chmod一下) cd bin.linux* 查看一下bjam已经生成 export PATH=$PATH:/boost/boost_1_44_0/tools/jam/src/bin.原创 2011-11-01 10:05:42 · 703 阅读 · 0 评论 -
ubuntu安装boost1.44
./build_dist.sh ./bjam --without-python --toolset=gcc install或者./bootstrap.sh./bjam --layout=versioned --build-type=complete --prefix=/home/test/boost --toolset=gcc install原创 2011-11-21 19:13:26 · 647 阅读 · 0 评论