duration.cpp: In function ‘std::__cxx11::string format_duration(int)’:
duration.cpp:77:32: error: expected unqualified-id before ‘(’ token
result += time[idx]->();
^
duration.cpp:82:32: error: expected unqualified-id before ‘(’ token
result += time[idx]->() + " and ";
^
duration.cpp:87:32: error: expected unqualified-id before ‘(’ token
result += time[idx]->() + ", ";
^
You get some warnings, too. Line 54 above, you use = when you mean ==.
Also, idx (line 73) is better as a size_t (or at least unsigned).
As for trying to call operator(), you can't say time[idx]->(). Try time[idx]->operator()(). (It also seems to work if you say (*time[idx])(), but I'm not sure if that's correct with virtual functions.)
And you seem to have your Hours and Days mixed up in the push_backs.
"expected unqualified-id" is just complaining about a missing name between -> and (). Syntactially, you can say p->f() but can't say p->(), even if operator() has been defined for p's class.
A qualified id is one that specifies a scope using ::. Such an id would be a syntax error at that point (e.g., p->::f() is an error). So it mentions an "unqualified" id, but a friendlier error message would just say "missing method name after ->".
BTW, now that I think about it, (*time[idx])() should be okay since p->f() is just "syntactic sugar" for (*p).f().