微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

*未指定*在C typedef语句中是什么意思?

我看到这样的声明

typedef *unspecified* value_type;

typedef *unspecified* reference;

在Boost :: multi_array类的声明中.

namespace boost {

template <typename ValueType,std::size_t NumDims,typename Allocator = std::allocator<ValueType> >
class multi_array {
public:
// types:
  typedef ValueType                             element;
  typedef *unspecified*                         value_type;
  typedef *unspecified*                         reference;
  typedef *unspecified*                         const_reference;
  typedef *unspecified*                         difference_type;
  typedef *unspecified*                         iterator;
  typedef *unspecified*                         const_iterator;
  typedef *unspecified*                         reverse_iterator;
  typedef *unspecified*                         const_reverse_iterator;
  typedef multi_array_types::size_type          size_type;
  typedef multi_array_types::index              index;
  typedef multi_array_types::index_gen          index_gen;
  typedef multi_array_types::index_range        index_range;
  typedef multi_array_types::extent_gen         extent_gen;
  typedef multi_array_types::extent_range       extent_range;
  typedef *unspecified*                         storage_order_type;

*未指定*是什么意思?这是C11标准吗?

解决方法

我在文档中假设,而不是可编译的代码,因为它是不可编译的.

通常这样做可以指示typedef可以使用,但是别名的类型取决于实现,并不被视为公共接口的一部分.

在这种情况下,可编译头文件包含以下行号的声明:

typedef typename super_type::value_type value_type;

其中别名类型在基类中定义.更深入地挖掘,反过来来自另一个基类,实际的类型深深地埋在实现细节中,根据数组的维数有不同的定义;这种特定类型是一维数组的ValueType,multi_array< ValueType,NumDims-1>更高的尺寸.

原文地址:https://www.jb51.cc/c/115003.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐