|
Boost : |
From: Branko Èibej (branko.cibej_at_[hidden])
Date: 2000-05-18 03:36:32
John Maddock wrote:
> the normal solution for this
> situation is to use a singleton: boost::singleton anyone?
I've been playing around with the idea for aome time now, but this
was absolutely the last straw :)
It's in the vault, folder singleton, there's also a testcase in
singletest.cpp. I haven't bothered about copyrights and documentation
yet (should be fairly obvious), that can wait until I get some comments
about the proposed interface. In short:
class singleton is a public base class for singleton classes
pro: lets you create trees of singleton classes and register
the correct class at runtime.
con: requires support functions in derived classes (sigh,
no boilerplates in C++...)
There are still a few holes in the interface which I'm working on; but
for now, I'd appreciate any feedback to see if I'm on the right track.
Tested with g++ (egcs-1.1, latest snapshots) and MSVC++ (urgh, why can't they
support member templates).
Brane
-- Branko Èibej <branko.cibej_at_[hidden]> HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia voice: (+386 1) 586 53 49 fax: (+386 1) 586 52 70
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk