ciao.
Sto cercando di capire le unary_function:
ho trovato queste spiegazioni sul perchè derivare il functore da unary_function:codice:template<typename T> struct DeleteObject: public unary_function<const T*, void> { void operator()(const T* ptr) const delete ptr; } };
quello che non ho capito è il concetto di "Adaptable" mentre ho capito cosa sono i nested type.Unary_function is an empty base class: it contains no member functions or member variables, but only type information. The only reason it exists is to make it more convenient to define types that are models of the concept Adaptable Unary Function. Specifically, any model of Adaptable Unary Function must define nested typedefs. Those typedefs are provided by the base class unary_function.