I'm trying to convert some ascii characters into another one. However I've been unable due to inexperience with variadic template syntax.
template<typename T>
void despecialize(const T& original, T& totransform, const int& charnum)
{
if (static_cast<int>(totransform) == charnum) {
totransform = original;
}
}
template<typename T>
void despecialize(const T& original, T& totransform, const int& charnum, const int& charother...)
{
despecialize(original, totransform, charnum);
despecialize(original, totransform, charother...); //C3546 there are no parameter packs available to expand
}
std::string removePortugueseSpecialLetter(std::string& data)
{
std::string transformed;
for (auto& c : data)
{
despecialize('a', c, 176, 131, 132, 133, 134);
transformed += c;
}
return transformed;
}
What should be the correct syntax?