fork download
  1. #include <list>
  2. #include <type_traits>
  3.  
  4. template <typename Container>
  5. class AwesomeClass
  6. {
  7. public:
  8. typedef typename std::common_type< Container > value_type;
  9.  
  10. bool firstUse;
  11.  
  12. Container *theList;
  13. typename Container::iterator theIterator;
  14. explicit AwesomeClass(Container &list):theList(&list)
  15. {
  16. }
  17. };
  18. int main() {
  19. // you can use typedef if you like
  20. typedef std::list<int> intList;
  21. intList list;
  22. AwesomeClass<intList> newInt(list);
  23. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty