摘要: 获取当前时间戳 #include <iostream> #include <sys/time.h> int main(){ struct timeval tv; gettimeofday(&tv, NULL); auto count = tv.tv_sec * 1000ul + tv.tv_usec 阅读全文
posted @ 2024-01-12 17:07 He_LiangLiang 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 在 C++ 中,仿函数是一种可以像函数一样调用的对象。 通过实现 operator(),你可以创建一个类或结构体,然后像函数一样使用它,这就是仿函数的概念。 当我们谈到仿函数时,通常是指定义了函数调用运算符 operator() 的类或结构体。 以下是两个简单的 C++ 仿函数示例,一个用于比较整数 阅读全文
posted @ 2024-01-12 13:52 He_LiangLiang 阅读(19) 评论(0) 推荐(0) 编辑