fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. struct Concat
  8. {
  9. string val;
  10. Concat(initializer_list<string> l)
  11. {
  12. for(auto s: l) val = val + s + " ";
  13. }
  14. };
  15.  
  16.  
  17. int main(int argc, const char * argv[])
  18. {
  19. Concat c = { "Hello", "world", "it", "is", "me" };
  20. cout << c.val << endl;
  21. }
  22.  
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
Hello world it is me