参考:https://www.jianshu.com/p/f191e88dcc80 1. std::function std::function 是一个可调用对象包装器,是一个类模板,可以容纳除了类成员函数指针之外的所有可调用对象,它可以使用统一的方式处理函数、函数对象、函数指针,并允许保存和延迟它 Read More
posted @ 2019-11-22 17:19 小荷才楼尖尖角 Views(575) Comments(0) Diggs(0) Edit
在c++中,动态内存管理是通过new/delete 运算符来进行的。由于确保在正确的时间释放内存是很困难的,为了避免内存泄漏,更加容易,安全地使用动态内存,C++11标准库提供了两种智能指针类型来管理动态对象。只能指针的行为类似于常规指针,重要的区别是它负责自动释放所指的对象。 std::share Read More
posted @ 2019-11-22 15:33 小荷才楼尖尖角 Views(16773) Comments(0) Diggs(0) Edit
#include #include #include #include #include template class ThreadSafeQueue{ public: void Insert(T value); void Popup(T &value); bool Empty() const; private: ... Read More
posted @ 2019-11-22 15:05 小荷才楼尖尖角 Views(544) Comments(0) Diggs(0) Edit