$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] binding to new
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2009-04-22 17:13:22
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.