fork download
  1. #include <string>
  2. class spriteSheet
  3. {
  4. public:
  5. spriteSheet(const std::string& str) {}
  6. };
  7.  
  8. struct player
  9. {
  10. spriteSheet image;
  11. player(spriteSheet& s1) : image("abc123")
  12. {
  13. image = s1; // now it's ok to assign
  14. }
  15. };
  16.  
  17. int main()
  18. {
  19. spriteSheet s("123");
  20. player p(s);
  21. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty