Is your feature request related to a problem? Please describe.
Currently, we have:
std::string to_str(tile_type t) //!OCLINT cannot be simpler
{
switch (t)
{
case tile_type::arctic: return "arctic";
// ...
case tile_type::woods: return "woods";
}
assert(!"Should not get here"); //!OCLINT acceptable idiom
return "";
}
The OCLint tag is wrong. Take a look at to_tile:
tile_type to_tile(std::string str)
{
const std::map<std::string, tile_type> m{
{ "arctic", tile_type::arctic},
// ...
{ "beach", tile_type::beach}
};
//This assert will fail if the string is not in the map
assert(m.find(str) != std::end(m));
return m.find(str)->second;
}
Describe the solution you'd like
Apply the approach used in to_tile in to_str. All tests should still pass. OCLint tag must be removed, iff allowed by OCLint.
Is your feature request related to a problem? Please describe.
Currently, we have:
The OCLint tag is wrong. Take a look at
to_tile
:Describe the solution you'd like
Apply the approach used in
to_tile
into_str
. All tests should still pass. OCLint tag must be removed, iff allowed by OCLint.Describe alternatives you've considered
None.
Additional context
None.