Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-07-09 14:14:55


From: "David B. Held" <dheld_at_[hidden]>
> // I don't think I can use boost::function here because it will miss
> // the __fastcall decoration which is part of how these functions
> // are declared.
> template <typename T,
> T (__fastcall TRegistry::*ReadValue)(AnsiString const),
> void (__fastcall TRegistry::*WriteValue)(AnsiString const, T)>
> class TOptionBase
> {
[...]
> T const& Read(void)
> {
> return Value_ = (Registry_.get()->*ReadValue)(Name_);
> // Now, I could just as easily call:
> // return Value_ = boost::bind(ReadValue, Registry_)(Name_);
> // Except I don't think that's quite as readable, personally,
> // and unfortunately, bcc doesn't like it.
> }

An operator->* would probably fail here, too, unless it's specifically made
to recognize __fastcall member pointers. bind currently knows about
__stdcall but not __fastcall. get() is your best bet. :-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk