template <typename T>
void printReverse(const std::vector<T>& arr)
{
for (int index{ static_cast<int>(arr.size()) - 1}; index >= 0; --index) // index is signed
{
std::cout << arr[static_cast<std::size_t>(index)] << ' ';
}
std::cout << '\n';
}
i'm learning c++, what the fuck is this shit? i understand that the indexing is unsigned but this is so fucking retarded, do people really do this in the real world?