fork(1) download
  1. #include <iostream>
  2. typedef int Entity;
  3. struct Attachment {
  4. Entity entity;
  5. Attachment(Entity& mEntity) : entity(mEntity) { }
  6. };
  7.  
  8. // ---
  9. // User code
  10. struct MyAttachment1 : Attachment {
  11. // This is annoying to write for every attachment type
  12. // Especially when there are other constructor arguments
  13. // And if there are a lot of attachment types
  14. using Attachment::Attachment;
  15. };
  16. int main() {
  17. // your code goes here
  18. int i =1;
  19. MyAttachment1 a(i);
  20. return 0;
  21. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty