*未指定*在C++ typedef语句中的含义是什么?

Sul*_*lla 9 c++ typedef declaration c++11

我看到像这样的陈述

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;
Run Code Online (Sandbox Code Playgroud)

*未指定*在这里意味着什么?这是C++ 11标准吗?

Mik*_*our 13

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

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

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

typedef typename super_type::value_type value_type;
Run Code Online (Sandbox Code Playgroud)

别名类型在基类中定义的位置.深入挖掘,反过来来自另一个基类,实际类型深深埋藏在实现细节中,具有不同的定义取决于数组的维数; 这种特殊类型ValueType用于一维数组,multi_array<ValueType,NumDims-1>用于更高维度.


Xeo*_*Xeo 9

这看起来像是从这个文档中复制而来的.*unspecified*只是意味着,它与你完全无关,而且它是一个实现细节.不要再深入了解它,只是承认,typedef就在那里.