diff --git a/MSVC/1200/Readme.txt b/MSVC/1200/Readme.txt index 00069fc..79d51a3 100644 --- a/MSVC/1200/Readme.txt +++ b/MSVC/1200/Readme.txt @@ -29,6 +29,10 @@ If you use Singletons with longevity you must add Singleton.cpp to your project/ Fixes: ------ + Mar 20, 2003: + ------------- + * In MultiMethods.h: Fixed bugs in FnDispatcher and FunctorDispatcher. + Fixing FnDispatcher lead to an Interface change (see section "Interface changes"). Mar 08, 2003: ------------- @@ -203,6 +207,69 @@ Unfortunately the MSVC 6.0 supports neither of them. } [/code] + Unfortunately adding dummy-parameters does not always work. + For example for one of FnDispatcher's Add-member-functions you have to explicitly + specify two type- and one non-type parameter. + [code] + template + class FnDispatcher + { + public: + //... + template + void Add(){/*...*/} + }; + //... + FnDispatcher dis; + dis.Add(); + [/code] + Using dummy-parameters as workaround FnDispatcher::Add would become something + like this: + [code] + template + struct Helper {}; + + template + class FnDispatcher + { + public: + //... + template + void Add(Helper) + {} + }; + //... + FnDispatcher f; + f.Add(Helper()); + [/code] + This compiles fine, but alas Add never gets called. I don't know what happens, + I only know that the MSVC 6.0 won't generate code for a function call. + + In situations like that, instead of dummy-Parameters I used nested template-classes + with overloaded function-operator as a workaround. + [code] + template + class FnDispatcher + { + public: + // the member-function Add becomes a member-template-class + // with overloaded function operator. + template + struct AddI + { + void operator()(FnDispatcher& o) {/*...*/} + }; + }; + //... + FnDispatcher f; + FnDispatcher::AddI()(f); + [/code] + + If you know of a better workaround, please let me know. + D. Virtual functions that use covariant return types (e.g. return a pointer to Derived) in the original library were changed so that they have exactly the same return type as the original virtual function (e.g. return a pointer to Base). @@ -539,6 +606,21 @@ Interface changes: { x.Add(&Hatch_Helper::HatchShapes); } + + Some words to FnDispatcher: + --------------------------- + The trampoline-Versions of FnDispatcher::Add differ + from the original library. + + Using the original library one writes: + typedef FnDispatcher Dispatcher; + void Hatch(Rectangle& lhs, Poly& rhs) {...} + + Dispatcher dis; + disp.Add(); + + Using this port the last line has to be: + Dispatcher::AddI()(dis); More info: ----------