fork download
  1. #include <iostream>
  2.  
  3. using std::cout;
  4. using std::endl;
  5.  
  6. template <typename T>
  7. struct Box {
  8. T value;
  9. operator T() { return value; }
  10. };
  11.  
  12. int main() {
  13. Box<int> b{42};
  14. int i = b;
  15. cout << i << endl;
  16. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
42