PaddlePaddle / PaddlePaddle/Paddle

咨询编码规范的问题

Open
#51,150 4 comments 0 reactions 1 assignee View on GitHub

@an1018 is already working on this.

Since Mar 3, 2023.

status/following-up type/question
Dominant language
C++
Stars
24.1k
Forks
6k
Avg merge
4d 17h
Merged PRs (30d)
60

Description

请提出你的问题 Please ask your question

请问一个编码规范的问题:函数的参数如果是指针或者引用,&以及*标记,应该贴着变量名还是贴着类型名?我发现两种写法都有,例如:

这个是贴着变量名,即,靠后:https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/gpu/argsort_kernel.cu#L393
图片

这个是贴着类型名,即,靠前:https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/argsort_kernel.h#L42
图片

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.