Comments (1)
对,是的,queue的定义是:std::queue<std::unique_ptr<T>> queue_;
queue中的内容,实际上是unique_ptr类型。
这种类型,实际上仅能通过std::move来传递,无法直接赋值传递。
if (queue_.empty()) {
return std::unique_ptr<T>();
}
顺便还查了一下,上面这句话能过,是因为在返回的时候,对于返回值来说:
1.如果支持move构造,那么调用move构造。
2.如果不支持move,那就调用copy构造。
3.如果不支持copy,那就报错。
unique_ptr是支持move构造的,unique_ptr对象可以被函数返回。
感谢大佬指正。
from cgraph.
Related Issues (20)
- 关于节点返回错误导致崩溃的一个bug HOT 3
- 可以考虑 本地任务在执行的时候,多执行几次
- 调用makeSerial ,Pipeline阻塞无法执行 HOT 1
- 这里给删掉吧,不用 了
- 线程池初始化vector竞争bug HOT 5
- 这里 在windows上报了 wall,看看如何解决吧 HOT 1
- 考虑一下 owns_lock() 能在哪里做出优化
- 批猪是我努力奋斗和跟上的榜样! HOT 1
- 静态多态 HOT 3
- trigger_times 这个信息,可以放到 fatProcessor 里去了
- 将所有的h 文件,和 cpp文件 分开 HOT 2
- 考虑取消 EParam 的设定
- 这里,继承自 CStruct 即可
- 提供线程安全的参数获取方式 HOT 1
- 这里应该使用 getCurState
- 这里可以稍微合并一下
- thread结束的时候,使用 notify all一下
- 看这里是否可以通过 减少notify 的方式,来增加并行速度 HOT 2
- 如果 element 后面的是 empty,这里都是不需要的 HOT 1
- Hope adding vcpkg package for cgraph HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgraph.