什么" typedef见下文"在c ++标准库源代码中意味着什么?

时间:2016-12-01 08:51:19

标签: c++ llvm unique-ptr

当我阅读标准库的源代码时,我总是看到&#34的用法;见下文"例如,在libcxx内存源代码:http://llvm.org/svn/llvm-project/libcxx/trunk/include/memory中,在unique_ptr定义中,一段带有" typedef的代码见下面的指针"代码如下所示:

typedef see below pointer;
typedef T element_type;
typedef D deleter_type;

// constructors
constexpr unique_ptr() noexcept;
explicit unique_ptr(pointer p) noexcept;
unique_ptr(pointer p, see below d1) noexcept;
unique_ptr(pointer p, see below d2) noexcept;
unique_ptr(unique_ptr&& u) noexcept;
unique_ptr(nullptr_t) noexcept : unique_ptr() { }
template <class U, class E>
    unique_ptr(unique_ptr<U, E>&& u) noexcept;
template <class U>
    unique_ptr(auto_ptr<U>&& u) noexcept;
...

我想知道这是什么意思,以及它是如何运作的?谢谢!

2 个答案:

答案 0 :(得分:3)

这是评论的一部分。下次使用语法高亮显示查看文件。

答案 1 :(得分:0)

除非你有像

这样的设计
#define see const; /*you are allowed to define something to a keyword*/
struct below{};
typedef see below pointer;/*this will now compile*/

typedef see below pointer;在语法上无效。它是您引用的源代码文档的一部分。