上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: package com.lidaochen.test; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Base... 阅读全文
posted @ 2019-05-30 15:22 李道臣 阅读(318) 评论(0) 推荐(0) 编辑
摘要: package com.lidaochen.test; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.supp... 阅读全文
posted @ 2019-05-30 15:11 李道臣 阅读(299) 评论(0) 推荐(0) 编辑
摘要: package com.lidaochen.test; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.supp... 阅读全文
posted @ 2019-05-29 22:25 李道臣 阅读(598) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; // transform 将一个容器的元素 搬运 到另一个容器中 struct MyPlus { int operator()(int val) { return val + 100; } }; void MyPrint(int val) { ... 阅读全文
posted @ 2019-05-28 21:03 李道臣 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 谓词是指普通函数或重载的 operator()返回值是 bool 类型的函数对象(仿函数)。如果operator 接受一个参数,那么叫做一元谓词,如果接受两个参数,那么叫做二元谓词,谓词可作为一个判断式。例如: 函数对象适配器是完成一些配接工作,这些配接包括绑定(bind),否定(negate),以 阅读全文
posted @ 2019-05-28 20:14 李道臣 阅读(220) 评论(0) 推荐(0) 编辑
摘要: STL 内建了一些函数对象。分为:算数类函数对象,关系运算类函数对象,逻辑运算类仿函数。这些仿函数所产生的对象,用法和一般函数完全相同,当然我们还可以产生无名的临时对象来履行函数功能。使用内建函数对象,需要引入头文件 #include<functional>。 6 个算数类函数对象,除了 negat 阅读全文
posted @ 2019-05-28 19:18 李道臣 阅读(709) 评论(0) 推荐(1) 编辑
摘要: 重载函数调用操作符的类,其对象常称为函数对象(function object),即它们是行为类似函数的对象,也叫仿函数(functor),其实就是重载“()”操作符,使得类对象可以像函数那样调用。注意:1.函数对象(仿函数)是一个类,不是一个函数。2.函数对象(仿函数)重载了”() ”操作符使得它可 阅读全文
posted @ 2019-05-28 18:58 李道臣 阅读(1621) 评论(0) 推荐(0) 编辑
摘要: 如果我们没有提供拷贝构造函数,没有重载=操作符,vector 对我们的 mc 对象进行的简单的浅拷贝,将拷贝的对象插入到容器中,导致我们的 mc 对象的 data 指针和容器中mc 对象的拷贝对象中的 data 指针都指向了我们在堆区分配的内存,当函数结束,两个对象都调用了析构函数,先调用析构函数的 阅读全文
posted @ 2019-05-27 22:34 李道臣 阅读(6946) 评论(0) 推荐(1) 编辑
摘要: package com.lidaochen.test; import java.io.ByteArrayOutputStream; import java.io.InputStream; public class StreamTools { // 把InputStream转换成String public static String readStream(InputStream... 阅读全文
posted @ 2019-05-27 20:10 李道臣 阅读(543) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include using namespace std; #define SALE_DEPATMENT 1 // 销售部门 #define DEVELOP_DEPATMENT 2 // 研发部门 #define FINACIAL_DEPATMENT 3 // 财务部门 // multima... 阅读全文
posted @ 2019-05-26 22:39 李道臣 阅读(459) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页