包装函数以返回其他类型

问题描述

我有一个结构x,在将它作为参数传递给函数之前,需要将其转换为其他形式。

例如,

static struct ss x = {{x1,y1,z1},{x2,y2,z2},{x3,y3,z3}};

int out1 = function1( std::span<const a>(x))
int out2 = function2( std::span<const a>(x))
int out3 = function3( std::span<const a>(x))

出于将函数调用内部转换为std::span<const a>(x)的目的,我如何将x包装在函数中以返回类型std::span<const a>?

这样我就可以将函数调用为int out1 = function1( funx())

否则,用functionx作为类型为std :: span的参数调用x的最简单方法是什么

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)