fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Something
  5. {
  6. public:
  7. Something(std::string str, int i, float f) { }
  8. };
  9.  
  10. class SomethingElse
  11. {
  12. private:
  13. Something somethingA = Something("Test", 357, 1.5f);
  14. Something somethingB = {"Stuff", 753, 7.77f};
  15. Something somethingC{"This also works", 357, 0.0f};
  16.  
  17. //Something somethingD("This doesn't compile...", 357, 0.0f);
  18. };
  19.  
  20. int main() {
  21. // your code goes here
  22. return 0;
  23. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty