[C++11] 중괄호 초기화 리스트 (initializer list)
중괄호를 이용해 다양한 타입의 객체를 초기화할 수 있다. int x {10}; // x를 10으로 초기화std::string str {"Hello"}; // std::string 객체를 "Hello"로 초기화int arr[] {1, 2, 3, 4, 5}; // 배열을 1, 2, 3, 4, 5로 초기화struct Point { int x; int y;};Point p {5, 10}; // Point 구조체 변수 p를 초기화class MyClass {public: MyClass(int value) : data(value) {} // 멤버 변수 초기화 리스트로 초기화private: int data;};int main() { MyClass obj1(10); // 소괄호 사용,..