Skip to content

Inline function defintion error#799

Open
Mq-b wants to merge 2 commits into
google:gh-pagesfrom
Mq-b:inline-function-defintion-error
Open

Inline function defintion error#799
Mq-b wants to merge 2 commits into
google:gh-pagesfrom
Mq-b:inline-function-defintion-error

Conversation

@Mq-b

@Mq-b Mq-b commented Jan 27, 2024

Copy link
Copy Markdown

The original description is unclear:

You can declare functions in a way that allows the compiler to expand them inline rather than calling them through the usual function call mechanism.

I think it should be emphasized that defining inline functions, whether with the standard C++ keyword 'inline' or some other compiler extension, is just a 'suggestion'. The original text seems unclear.

The compiler can inline a function whether or not it is defined inline.

cppreference:

Since this meaning of the keyword inline is non-binding, compilers are free to use inline substitution for any function that's not marked inline, and are free to generate function calls to any function marked inline. Those optimization choices do not change the rules regarding multiple definitions and shared statics listed above.

Inline variables eliminate the main obstacle to packaging C++ code as header-only libraries.
(since C++17)


In the previous Microsoft documentation, there was also some discussion of inline functions:

MicrosoftDocs/cpp-docs#4823

@google-cla

google-cla Bot commented Jan 27, 2024

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@vapier vapier added the lang:cpp The C++ language label Jul 8, 2024
@Mq-b

Mq-b commented Feb 10, 2025

Copy link
Copy Markdown
Author

@vapier I want to know what the problem is with this modification and why it has not been reviewed yet.

@vapier

vapier commented Feb 10, 2025

Copy link
Copy Markdown
Member

afaict, you haven't completed the CLA steps as flagged above. no one looks at PRs that have CLA issues by policy.

that said, I also don't work on C++, or keep track of it.

@Mq-b

Mq-b commented Feb 10, 2025

Copy link
Copy Markdown
Author

sorrySorry, what about now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:cpp The C++ language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants