June 2017
Intermediate to advanced
532 pages
12h 59m
English
We will implement a function that tries to be able to print everything. It uses std::any as its argument type:
#include <iostream> #include <iomanip> #include <list> #include <any> #include <iterator> using namespace std;
using int_list = list<int>;
void print_anything(const std::any &a) {
Read now
Unlock full access