#include "Teuchos_ParameterList.hpp" #includeint main(){ Teuchos::ParameterList list; list.set("param1", 42); list.set("param2", "hello"); list.set("param3", true); list.print(std::cout); return 0; }
{ param1 = 42, param2 = hello, param3 = true }
#include "Teuchos_ParameterList.hpp" #includeint main(){ Teuchos::ParameterList list; list.set("param1", 42, "An integer parameter"); list.set("param2", "hello", "A string parameter"); list.set("param3", true, "A boolean parameter"); list.describe(std::cout, Teuchos::VERB_MEDIUM); return 0; }
---Showing ParameterList--- Number of Parameters: 3 ------------------------- 0 : "param1" Type: int Default Value: 42 Description: An integer parameter --- 1 : "param2" Type: string Default Value: "hello" Description: A string parameter --- 2 : "param3" Type: bool Default Value: true Description: A boolean parameter ---Therefore, it can be concluded that the examples given here are from the Teuchos package library.