pb_ds (<ext/pb_ds/assoc_container.hpp>
and 4 other headers) is a GNU C++ library for some data structures(e.g. red black tree). And I encountered the code of applying update when the tree is modified:
PB_DS_CLASS_T_DEC
template<typename Node_Update_>
inline void
PB_DS_CLASS_C_DEC::
apply_update(node_pointer p_nd, Node_Update_* /*p_update*/)
{
node_update::operator()(node_iterator(p_nd),
node_const_iterator(static_cast<node_pointer>(0)));
}
where the node_update
class is of the following form:
template<class Node_CItr,class Node_Itr,class Cmp_Fn,class _Alloc>
struct my_node_update
{
typedef my_type metadata_type;
void operator()(Node_Itr it, Node_CItr end_it)
{
//...
}
};
and I was confused about the code node_update::operator()...
which I think calls a non-static member function from the node_update
class, but did not create an object. So how did the call work?