Hello,
I'm trying to create ObjectHandler::property_t variable, which will later converted to other library type by ObjectHandler::convert2 e.g. ObjectHandler::property_t DealMaturityCpp( longTypeVar ); This compiled fine on windows, but failed on Mac with error: /opt/local/include/boost/variant/variant.hpp:1534:28: Call to member function 'initialize' is ambiguous How should I convert from native type like long, double, bool etc, to ObjectHandler::property_t? Thank you! Regards Jerry ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Jerry,
> I'm trying to create ObjectHandler::property_t variable, which will > later converted to other library type by ObjectHandler::convert2 > > e.g. > > ObjectHandler::property_t DealMaturityCpp( longTypeVar ); > > This compiled fine on windows, but failed on Mac with error: > > /opt/local/include/boost/variant/variant.hpp:1534:28: Call to member > function 'initialize' is ambiguous > > How should I convert from native type like long, double, bool etc, to > ObjectHandler::property_t? Apologies for the delay in getting back to you. I will try to be quicker with any follow up. Above the line of boost code which fails to compile, I find the following comment: // NOTE TO USER : // Compile error here indicates that the given type is not // unambiguously convertible to one of the variant's types // (or that no conversion exists). But based on the info you provided I don't see why that error occurs. If the variable called longTypeVar was declared with type long then I would not expect that error. Can you provide more information? Kind Regards, Eric ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Eric No problem, I've fixed this, it can be closed using static_case will work in Windows/Mac/Linux ObjectHandler::property_t propertyVar = ObjectHandler::property_t(static_cast<long>longTypeVar) Regards Jerry On Mon, Aug 29, 2016 at 4:30 PM, Eric Ehlers <[hidden email]> wrote: Hi Jerry, ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |