// {{{ headers #include #include // }}} using namespace std; using namespace blitz; typedef TinyVector VectorType; typedef Array ArrayType; template TA testfunc(TA val, TB val2) { return static_cast(val*val2); } BZ_DECLARE_FUNCTION2(testfunc) int main(int argc, char** argv) { try { ArrayType a (Range(0,3)); a = testfunc(tensor::i, 2.3); std::cout << a << std::endl; } catch(std::exception& e) { std::cerr << "Caught "<< e.what() << std::endl; return 1; } catch(...) { std::cerr << "Caught unknown exception" << std::endl; return 1; } return 0; }