Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在C++中用Python仿真函数导入_C++ - Fatal编程技术网

在C++中用Python仿真函数导入

在C++中用Python仿真函数导入,c++,C++,在python中,我可以执行以下操作: 从长到短,痛苦的导入仍然是长到短 在C++中,我被困: using long::and::painful::stillWayToLong; ... //Code and Stuff stillWayToLong("Why must I type this so often?"); 我是不是错过了一些能让这更像蟒蛇的东西?怎么样 auto x = long::and::painful::stillWayToLong; // If this is an o

在python中,我可以执行以下操作: 从长到短,痛苦的导入仍然是长到短

在C++中,我被困:

using long::and::painful::stillWayToLong;
... //Code and Stuff
stillWayToLong("Why must I type this so often?");
我是不是错过了一些能让这更像蟒蛇的东西?

怎么样

auto x = long::and::painful::stillWayToLong;  // If this is an object/function
x("Why must I type this so often?");


using X = typename long::and::painful::stillWayToLong; // If this is a type.
X bob;

让它更像是python,不,但是你也许不能使用很长的标识符。当然,不要尝试用C++中的标识符作为标识符。或者长的,或者相关的?为了完整性起见,使用x=long::And::pauld::stillWayToLong;如果stillWayTooLong是一个名称空间。