FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
template<typename T >
FB::detail::VariantMapInserter< T > FB::variant_map_of ( const T &  t,
const FB::variant v 
)

Allows convenient creation of an FB::VariantMap.

Returns
A helper type that overloads operator() for insertion and is convertible to FB::VariantMap.

Examples:

typedef std::map<std::string, FB::variant> StringVariantMap;
StringVariantMap varMap = FB::variant_map_of<std::string>("a",1)("b","2")("c",3.4);
FireEvent("randomDiceRoll", FB::variant_map_of<std::string>("foo",42));
std::string x = "xyz";
StringVariantMap varMap2 = FB::variant_map_of(x, 1);

Definition at line 134 of file variant_map.h.

135  {
136  return FB::detail::VariantMapInserter<T>(t, v);
137  }