fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <functional>
  4.  
  5. struct Monster
  6. {
  7. bool isAlive() const { return false; }
  8. };
  9.  
  10. int main()
  11. {
  12. Monster mon[10];
  13.  
  14. if( std::none_of(mon, mon + 10, std::mem_fn(&Monster::isAlive)) )
  15. {
  16. std::cout << "Killed all Monster\n";
  17. }
  18. }
  19.  
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
Killed all Monster