上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: 1. boost::ptr_vector boost::ptr_vector knows that it stores dynamically allocated objects, member functions like back() return a reference to a dynami 阅读全文
posted @ 2019-05-29 17:55 c++11 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 1. boost::scoped_ptr is a smart pointer that is the sole owner of a dynamically allocated object and cannot be copied or moved. A smart pointer of typ 阅读全文
posted @ 2019-05-29 17:30 c++11 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 定义不定参数,使用的宏有: va_start(ap, arg) 初始化一个va_list的变量ap va_arg(ap, type) 获取下一个type类型的参数 va_end(ap) 结束使用ap 输出结果为:the result is 6 阅读全文
posted @ 2019-05-28 18:19 c++11 阅读(6441) 评论(0) 推荐(0) 编辑
摘要: 1. wildcard:扩展通配符 2. notdir:去除路径 3. patsubst:替换通配符 若有一个makefile如下: src=$(wildcard *.c ./sub/*.c) dir=$(notdir $(src)) obj=$(patsubst %.c, %.o, $(dir)) 阅读全文
posted @ 2019-05-28 16:21 c++11 阅读(1052) 评论(0) 推荐(0) 编辑
摘要: 风险指标用来对一个策略进行评价。 1. Total Returns 策略收益: total returns = (Pend - Pstart) / Pstart * 100% 其中 Pend = 策略最终股票和现金的总价值 Pstart = 策略开始股票和现金的总价值 2. Total Annual 阅读全文
posted @ 2019-05-20 19:22 c++11 阅读(1104) 评论(0) 推荐(0) 编辑
摘要: 以boost thread为例: 使用gdb进行编译:g++ -std=c++11 -g -Wall -I/usr/local/boost/include testThread.cpp -L/usr/local/boost/lib -lboost_system -lboost_thread -o t 阅读全文
posted @ 2019-05-05 17:45 c++11 阅读(4482) 评论(0) 推荐(0) 编辑
摘要: du -s * | sort -nr (-n是按数字大小排序,不能加上参数h) 阅读全文
posted @ 2019-03-04 11:42 c++11 阅读(923) 评论(0) 推荐(0) 编辑
摘要: 首先定义在多进程环境中的锁,采用读写锁,即可以同时读,但只能单独写。 头文件processLock.h 源文件processLock.cpp 实际应用: 阅读全文
posted @ 2019-03-01 16:23 c++11 阅读(2651) 评论(0) 推荐(0) 编辑
摘要: 1.线程管理 最重要的一个类是boost::thread,是在boost/thread.hpp里定义的,用来创建一个新线程。 上述执行函数的名称被传递到boost::thread的构造函数,一旦变量t被创建,该thread()函数在其所在线程中被立即执行。join()方法是一个阻塞调用:可以暂停当前 阅读全文
posted @ 2019-01-23 19:35 c++11 阅读(2970) 评论(0) 推荐(1) 编辑
摘要: 使用boost库的字符串处理之前,需要进行区域设置。类:std::locale,每个C++程序自动拥有一个此类的实例,不能直接访问全局区域设置。 全局区域设置可以使用类std::locale中的静态函数global()改变。 静态函数global()接受一个类型为std::locale的对象作为其唯 阅读全文
posted @ 2019-01-23 10:53 c++11 阅读(2754) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页