Capstone C++ Workflows
Checklist Status
A final checklist rolls several workflow booleans into a release-ready status.
Checklist Status
checklist_status.cpp
#include <iostream>
struct Checklist {
bool built;
bool tested;
bool packaged;
};
int completedCount(const Checklist& checklist) {
int count = 0;
if (checklist.built) {
count += 1;
}
if (checklist.tested) {
count += 1;
}
if (checklist.packaged) {
count += 1;
}
return count;
}
int main() {
bool packaged = ;
Checklist checklist{true, true, packaged};
int complete = completedCount(checklist);
bool ready = complete == 3;
std::cout << "packaged=" << packaged << std::endl;
std::cout << "complete=" << complete << std::endl;
std::cout << "ready=" << ready << std::endl;
return 0;
}
#include <iostream>
struct Checklist {
bool built;
bool tested;
bool packaged;
};
int completedCount(const Checklist& checklist) {
int count = 0;
if (checklist.built) {
count += 1;
}
if (checklist.tested) {
count += 1;
}
if (checklist.packaged) {
count += 1;
}
return count;
}
int main() {
bool packaged = ;
Checklist checklist{true, true, packaged};
int complete = completedCount(checklist);
bool ready = complete == 3;
std::cout << "packaged=" << packaged << std::endl;
std::cout << "complete=" << complete << std::endl;
std::cout << "ready=" << ready << std::endl;
return 0;
}
checklist
Named booleans make a release gate easier to inspect than unrelated loose variables.
status
Counting completed items creates an intermediate value that explains the final ready flag.