Typemap规则令人困惑 [英] typemap rule is confusing

查看:121
本文介绍了Typemap规则令人困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据MPI 2.2标准第4.1节:要创建新的数据类型,我们必须定义一个类型图,该类型图是(类型,位移)对的序列. 位移不是必需的,也可以是正的,增加的或唯一的.

According to MPI 2.2 standard Section 4.1: to create a new data type we have to define a typemap which is a sequence of (type, displacement) pairs. The displacements are not required to be positive, increasing, nor distinct.

  • 假设我按以下顺序定义了一个类型映射:{(double,0),(char,0)}这没有道理,但是有可能,一个标准如何提供这么多的灵活性?

推荐答案

如果这是唯一使您感到困惑的Typemap,那您比我聪明.但是对于这个特定的例子-C联合恰恰是这个.为什么typemap不允许呢?

If that's the only thing you find confusing about typemaps, you're smarter than I am. But as to this particular example -- C unions are exactly this; why shouldn't typemaps allow it?

这篇关于Typemap规则令人困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆