コード例 #1
0
ファイル: convert2.hpp プロジェクト: rdaluiso/quantlib
 value_t convert2(const container_t& c) {
     try {
         return c.operator value_t();
     }
     catch(const std::exception& e) {
         OH_FAIL("Unable to convert type '" << c.type().name()
             << "' to type '" << typeid(value_t).name() << "' - " << e.what());
     }
 }
コード例 #2
0
ファイル: cnv_tmpl.hpp プロジェクト: ChinaQuants/swig
 ComplexLib::Grade convertGrade(const container_t& c) {
     if(c.type() == typeid(double))
         return ComplexLib::Grade(c.operator double());
     else
         RP_FAIL("unable to convert type '" << c.type().name() << "' to type 'ComplexLib::Grade'");
 }