fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class test {
  5. public:
  6. test(int x) {
  7. std::cout << "int constructor\n";
  8. }
  9.  
  10. test(std::initializer_list<int> il) {
  11. std::cout << "initializer list constructor\n";
  12. }
  13. };
  14.  
  15. int main() {
  16. test t(5);
  17. test t1{5};
  18. test t2 = 5;
  19. return 0;
  20. }
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
int constructor
initializer list constructor
int constructor