Re: QuantLibXL / ObjectHandler 0.9.0 Prerelease Files

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/QuantLibXL-ObjectHandler-0-9-0-Prerelease-Files-tp11574p11577.html

On Wed, 2008-01-16 at 18:42 +0000, Eric Ehlers wrote:
> The prerelease files for version 0.9.0 of QuantLibAddin, QuantLibXL,
> ObjectHandler and gensrc are available at this link:

Hi Eric,
        if it doesn't break anything, you might want to apply this patch
to ObjectHandler. It fixes a strange problem with the C++ addin. At
least with VC++7 (I didn't check other compilers) if you pass a string
literal to a function expecting a Variant, it calls the Variant(const
bool&) constructor. Why it should think that conversion better than the
std::string one is beyond me...

Luigi


Index: ObjectHandler/oh/variant.hpp
===================================================================
--- ObjectHandler/oh/variant.hpp        (revision 14101)
+++ ObjectHandler/oh/variant.hpp        (working copy)
@@ -55,6 +55,7 @@
         Variant(const long &l) : variant_(l) {}
         Variant(const double &d) : variant_(d) {}
         Variant(const bool &b) : variant_(b) {}
+        Variant(const char *s) : variant_(std::string(s)) {}
                Variant(const std::string &s) : variant_(s) {}
 
         //! \name Inspectors




--

Greenspun's Tenth Rule of Programming:
Any sufficiently complicated C or Fortran program contains an
ad-hoc, informally-specified bug-ridden slow implementation of
half of Common Lisp.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev