You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently FuelClient::Models(...) returns an instance ModelIter. Iterating over all models looks like
auto iter = client.Models(server);
for (; iter; ++iter)
{
Model & model = *iter;
// ...
}
It would be more convenient to use range based for loops
for (Model & model : client.Models(server))
{
// ...
}
This can be done by making a function return an object with special methods begin() and end() where begin returns what FuelClient::Models(...) returns now, and end returns an iterator that compares inequal to a valid iterator.
classModels
{
/// \brief special method to support range-based for-loops; must be lowercasepublic: ModelIter begin();
/// \brief special method to support range-based for-loops; must be lowercasepublic: ModelIter end();
}
Since fuel-tools has already been released and a function's return type is not part of its signature, tick-tocking this requires changing the name of the function on FuelClient.
/// old and bustedpublic: IGN_DEPRECATED(2) ModelIter Models(const ServerConfig &_server);
/// new hotnesspublic: Models QueryModels(const ServerConfig &_server);
The text was updated successfully, but these errors were encountered:
Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Currently
FuelClient::Models(...)
returns an instanceModelIter
. Iterating over all models looks likeIt would be more convenient to use range based for loops
This can be done by making a function return an object with special methods
begin()
andend()
where begin returns whatFuelClient::Models(...)
returns now, and end returns an iterator that compares inequal to a valid iterator.Since fuel-tools has already been released and a function's return type is not part of its signature, tick-tocking this requires changing the name of the function on
FuelClient
.The text was updated successfully, but these errors were encountered: