【发布时间】:2021-10-28 15:19:18
【问题描述】:
我查看了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;
}
什么是@ 以及为什么在多行 cmets 中使用它。 @ 之后的文本也在我的 IDE 中突出显示(在 @defgroup 中),这是什么意思?
我在网上搜索了同样的结果,但没有找到令人满意的结果,结果显示operators in C++之类的东西。
【问题讨论】:
-
@在 cmets 中,而不是 c++ 的一部分。 -
这可能是一个 Doxygen 评论。
标签: c++ operators comments header-files