05 2019 档案

摘要:Boost.ScopeExit provides the macro BOOST_SCOPE_EXIT, which can be used to define something that looks like a local function but doesn't have a name. H 阅读全文
posted @ 2019-05-29 18:50 c++11 阅读(1132) 评论(0) 推荐(0)
摘要: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 阅读(213) 评论(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 阅读(331) 评论(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 阅读(6510) 评论(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 阅读(1168) 评论(0) 推荐(0)
摘要:风险指标用来对一个策略进行评价。 1. Total Returns 策略收益: total returns = (Pend - Pstart) / Pstart * 100% 其中 Pend = 策略最终股票和现金的总价值 Pstart = 策略开始股票和现金的总价值 2. Total Annual 阅读全文
posted @ 2019-05-20 19:22 c++11 阅读(1288) 评论(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 阅读(4563) 评论(0) 推荐(0)