// Create an empty ParameterList object ParameterList paramList; // Add a parameter to the list paramList["param1"] = 1.23; // Retrieve the value of a parameter double val = paramList.get("param1"); // Display the value std::cout << "param1 = " << val << std::endl;
// Create a ParameterList object ParameterList paramList; // Add some parameters to the list paramList["param1"] = 1.23; paramList["param2"] = 4.56; paramList["param3"] = 7.89; // Loop through the list and display the parameter keys and values for (auto itr = paramList.begin(); itr != paramList.end(); itr++) { std::cout << itr->first << " = " << itr->second << std::endl; }This example demonstrates how to loop through the list of parameters using an iterator. The `begin` and `end` methods are used to define the range over which the loop will iterate. The `first` member of the iterator points to the key of the parameter, while the `second` member points to its value. Package library: Open Babel.