fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <map>
  4. using namespace std ;
  5.  
  6.  
  7. template < typename T >
  8. std::ostream & operator<< ( std::ostream & stream , const std::vector<T> & obj )
  9. {
  10. for ( typename std::vector<T>::const_iterator it = obj.begin() , itEnd = obj.end() ; it!=itEnd ; ++it ) {
  11. stream << *it << ' ' ;
  12. }
  13. return stream ;
  14. }
  15.  
  16.  
  17. int main()
  18. {
  19. map<char,vector<bool> > table;
  20. table['x'] = vector<bool>{true,false, false,true} ;
  21. table['y'] = vector<bool>{0,0,0,1,0,1} ;
  22. map<char,vector<bool> >::iterator iter;
  23. for(iter=table.begin();iter!=table.end(); iter++)
  24. {
  25. cout << iter->first << ":" << iter->second <<endl;
  26. }
  27. }
  28.  
Success #stdin #stdout 0s 3432KB
stdin
Standard input is empty
stdout
x:1 0 0 1 
y:0 0 0 1 0 1