Skip to main content

Practice ยท 1 of 2

Braces Reject Narrowing

Complete Config with name (std::string, default "unset"), port (int, default 0), and tags (vector<string>, default empty), then implement int truncateToInt(double d) that compiles **only** because it avoids brace narrowing.

Difficulty: advanced

Back to lesson: Practice: Initialization Traps