2016-12-01 80 views
-1

当我在阅读标准库的源代码时,我总是看到“see below”的用法例如,在libcxx内存的源代码中:http://llvm.org/svn/llvm-project/libcxx/trunk/include/memory,在unique_ptr定义中,有一段代码“typedef参见下面的指针“代码如下所示:“typedef see below”在C++标准库源代码中是什么意思?

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; 
... 

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

+0

那么,你有没有看到下面是什么? – DeiDei

+0

这不是有效的源代码。它是'std :: unique_ptr'的**规范**的一部分,它是**文本**,不是可编译代码。 –

回答

3

这是评论的一部分。下次使用语法突出显示文件。

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;在语法上不合法。它是您引用的源代码文档的一部分。