1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include <iostream>
#include <tuple>
template <typename T>
std::tuple<T, T, T> homework(const T& a, const T& b, const T& c)
{
std::tuple<T, T, T> free_rider{a, b, c};
return free_rider;
}
template <typename T>
std::ostream& operator << (std::ostream& os, const std::tuple<T, T, T>& free_rider)
{
os << std::get<0>(free_rider) << "\n";
os << std::get<1>(free_rider) << "\n";
os << std::get<2>(free_rider) << "\n";
return os;
}
auto main() -> decltype(0)
{
std::tuple<int, int, int> free_rider{5050, 2550, 2550};
std::cout << free_rider;
}
|