影响其显式参数的方法是什么?

发布于 2024-09-25 10:40:36 字数 307 浏览 0 评论 0原文

我现在正在用 C++ 记录一些代码,我打算编写的方法之一将对数组进行排序。不过,它不会创建新数组,而是对给定数组的元素进行排序。我想添加一条评论,“如果原始排序对您很重要,那么就不要使用此方法!”但我宁愿说“对给定数组进行静态排序?!...危险!...带有突变!!!”像您这样的程序员能够理解。

用什么词形容这种方法?

额外问题:谁能推荐一个 C++ 工具,可以根据特殊格式的注释创建 HTML 文档,例如 javadoc?我选择的操作系统是 Ubuntu。

编辑:我是一名学生,我的作业是排序。

I'm documenting some code in C++ right now, and one of the methods I intend to write will sort an array. It won't create a new array, though, it will sort the elements of the given array in place. I want to include a remark along the lines of, "if the original ordering was important to you, then don't use this method!" But I would rather say something like "sorts the given array... statically?!... dangerously!... with mutations!!!" that programmers like you would be able understand.

What word describes this sort of method?

Bonus question: can anyone recommend a tool for C++ that creates HTML documentation from specially formatted comments, like javadoc? My operating system of choice is Ubuntu.

Edit: I'm a student and my assignment is to sort.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

宫墨修音 2024-10-02 10:40:36

对给定数组进行就地排序。

您知道 std::sortstd::stable_sort,对吧?

Sorts the given array in-place.

You are aware of std::sort and std::stable_sort, right?

各空 2024-10-02 10:40:36

函数修改参数是因为它们作为非 const 引用传入,这不是很明显吗? (无耻插件:请参阅这个答案确切的参数类型表示什么。)

并且您正在寻找 doxygen

Isn't it obvious that a function modifies parameters because they are passed in as non-const references? (Shameless plug: see this answer for what the exact parameter type signifies.)

And you're looking for doxygen.

梦里梦着梦中梦 2024-10-02 10:40:36

你已经说过了:正确的术语是“变异者”。

You already said it: the correct term is "mutator".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文