继续C++11的std::thread之旅!下面讨论如何给线程传递参数
这个例子是传递一个string#include
#include
#include void thread_function(std::string s)
{
std::cout << "thread function ";
std::cout << "m...
分类:
编程语言 时间:
2015-11-04 00:48:42
阅读次数:
171
/** * Created by icecookstar on 2015/11/3. * 归并排序 */public class MergeSort { private static void merge(int[] matrix, int first, int middle, int las...
分类:
编程语言 时间:
2015-11-04 00:30:31
阅读次数:
259
1.新建PassValueDelegate.h@protocolPassValueDelegate-(void)passValue:(NSString*)value; @end2.@interface AViewController : UIViewController-(void)passValu...
分类:
移动开发 时间:
2015-11-04 00:30:26
阅读次数:
1759
1、线程安全宏定义在TSRM/TSRM.h文件中有如下定义#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL)#define TSRMLS_FETCH_FROM_CTX(ctx) void ...
分类:
Web程序 时间:
2015-11-04 00:20:35
阅读次数:
279
1 + (void)drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor 2 { 3 CAShapeLay...
分类:
其他好文 时间:
2015-11-04 00:20:25
阅读次数:
154
1. 准备使用std::vector应该知道几点:(1)内存连续的容器,有点像数组(2)与std::list相比,插入和删除元素比较慢- 因为数据迁移(3)添加元素可能会引发内存分配和数据迁移。2. 问题AnyCAD::API::PointCloudNode使用FloatList 及std::vector来存储一些列的点[x0, y0, z0, x1, y1, z1, .....]:void S...
分类:
其他好文 时间:
2015-11-03 23:00:31
阅读次数:
208
直接源码:- (void) transitionWithType:(NSString *) type WithSubtype:(NSString *) subtype ForView : (UIView *) view{ //创建CATransition对象 CATransition *anim.....
分类:
移动开发 时间:
2015-11-03 22:41:15
阅读次数:
265
1.重载的概念:----->在同一个类中,允许存在同名函数,但它们的参数个数或者参数类型不同即可。public static void main(String[] args){System.out.println(add(1,2));System.out.println(add(1.11,2.22)...
分类:
其他好文 时间:
2015-11-03 22:26:11
阅读次数:
221
监听者模式方便的监听所需要的值得变化@implementation ViewController- (IBAction)Buton:(id)sender { self.view.backgroundColor=[UIColor redColor]; }- (void)viewDidLoad { .....
分类:
其他好文 时间:
2015-11-03 21:17:16
阅读次数:
231
在onCreate中注册广播,在onDestroy中注销。我原本在onStart中注册,被注册多次,无法全部注销,造成broadcast leak,有oom的危险,切记@Overrideprotected void onCreate(Bundle savedInstanceState) { supe...
分类:
其他好文 时间:
2015-11-03 21:11:52
阅读次数:
222