#include <iostream> #include <vector> using namespace std; class Bean { private: bool m_cool; public: Bean(bool cool) : m_cool(cool) { } bool isCool() const { return m_cool; } void beCool(bool cool) { m_cool = cool; } }; void we_cool(vector<Bean> &beans) { for (auto &bean : beans) { if (!bean.isCool()) { cout << "Not cool." << endl; bean.beCool(true); } } cout << "We cool." << endl; } int main(int argc, char *argv[]) { vector<Bean> beans = {Bean(true), Bean(false)}; we_cool(beans); return 0; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15129 | zachwhaley | Add practice directory |