22 Apr
2009
22 Apr
'09
9:13 p.m.
I have a factory that returns an instance of a concrete under an abstraction. It works by matching a "command" string to a command handler that is created and returned to the client. It's basically a stack of regex->creator pairs. The creator is a function that returns a pointer to the abstract type. I'd like to provide that function by binding to the new operator. Currently I have a static function in each concrete type that just calls new and I bind to it. I can't think of what syntax I would use to bind to new and am inclined to think it impossible, but I thought I'd ask.