Skip to content

ENH: Adopting a C++ style guide #22710

@seiko2plus

Description

@seiko2plus

Adopting a C++ style guide:

The current approach to using C++ is somewhat unclear. While trying to review #22315, I faced several obstacles, and I couldn't determine which style/rules I should follow; C++ is a monster of features compared to the C language. We urgently need to impose a specific code style to avoid chaos.

I suggest adopting the latest Google C++ Style guide, with minor modifications limited to the following:

  • C++ Version: code should target C++14 , or maybe keep it as-is C++17. Would it be possible? However, keep targeting C++11 in 2023 is too rigorous.

  • Spaces vs. Tabs: indent four spaces at a time.

  • Function Declarations and Definitions: similar to our C style, except the return type goes to the same line next to the function name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++Related to introduction and use of C++ in the NumPy code base

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions