Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/PyCGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ PYBIND11_MODULE(pycgraph, cg) {
py::arg("errorInfo"))
.def("__iadd__", &CStatus::operator+=,
py::return_value_policy::reference)
.def("__bool__", &CStatus::operator bool)
.def("getCode", &CStatus::getCode)
.def("getInfo", &CStatus::getInfo)
.def("reset", &CStatus::reset)
Expand Down
4 changes: 4 additions & 0 deletions src/CBasic/CStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ class CSTATUS {
return (*this);
}

explicit operator bool() const {
return this->isOK();
}

/**
* 恢复状态信息
*/
Expand Down
2 changes: 1 addition & 1 deletion src/UtilsCtrl/ThreadPool/UThreadPoolConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct UThreadPoolConfig : public CStruct {
* @return
*/
int calcStealRange() const {
int range = (std::min)(this->max_task_steal_range_, this->default_thread_size_ - 1);
const int range = (std::min)(this->max_task_steal_range_, this->default_thread_size_ - 1);
return range;
}

Expand Down
Loading