我正在查看C++
的queue
头文件,发现了一段代码。
队列头文件中的一段代码
#include <debug/debug.h>
#include <bits/move.h>
#include <bits/predefined_ops.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/**
* @defgroup heap_algorithms Heap
* @ingroup sorting_algorithms
*/
template<typename _RandomAccessIterator, typename _Distance,
typename _Compare>
_GLIBCXX20_CONSTEXPR
_Distance
__is_heap_until(_RandomAccessIterator __first, _Distance __n,
_Compare& __comp)
{
_Distance __parent = 0;
for (_Distance __child = 1; __child < __n; ++__child)
{
if (__comp(__first + __parent, __first + __child))
return __child;
if ((__child & 1) == 0)
++__parent;
}
return __n;
}
什么是@
,为什么在多行注释中使用它。此外,@
后的文本在我的IDE(在@defgroup
)中突出显示,这是什么意思?
我在网上搜索了相同的,但没有找到令人满意的结果,结果显示operators in C++
类的东西。
@
不是c++语言的一部分。注释中可以使用任何字符。注释可以有标记,这些标记可以由第三方处理器处理。在这种情况下,@
最有可能是氧。下面是上面注释中标记的一个例子:堆[排序].
注释中的标记的另一个例子是Visual c++中的XML Documentation。