mirror of
https://github.com/Manoj-HV30/dsa-competitive-programming.git
synced 2026-05-16 19:35:22 +00:00
5 lines
501 B
Markdown
5 lines
501 B
Markdown
>for(const auto& [value,symbol] : valueSymbols)
|
|
|
|
here [value,symbol] in cpp is called structured binding that allows you to unpack the elements of a compound object (such as a std::pair, std::tuple, or struct) into separate, named variables.
|
|
Each element of valueSymbols is a pair<int, string> representing a Roman numeral value and its symbol. The syntax for (const auto& [value, symbol] : valueSymbols) unpackseach pair so that value refers to the numeric part and symbol refers to the Roman string
|