fork download
  1. struct POD { int i, j; };
  2.  
  3. class A {
  4. POD m_pod;
  5. public:
  6. // A() : m_pod({1,2}) {} // error
  7. // A() : m_pod(static_cast<POD>({1,2})) {} // error
  8. A() : m_pod((POD) {1,2}) {} // ok!
  9. };
  10.  
  11. int main () { A obj; }
Success #stdin #stdout 0.02s 2720KB
stdin
Standard input is empty
stdout

Standard output is empty