Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    The proper way is to have the function definition a cpp file. But since your way is not proper, why you don't just ignore (disable) the warning? Commented May 20, 2022 at 16:10
  • @ixSci But if do_something is a function template, it may be not convenient to put it into a cpp file. Commented May 20, 2022 at 16:18
  • 1
    If it was a function template you would not have the inline keyword in the first place. Commented May 20, 2022 at 16:19
  • Please post full code needed to reproduce the problem. Please post the exact full verbatim error messages from your compiler. Warning: inline declaration of is there no file:line: first declared here ----> and then file:line: second time declared here --->? You have two declarations of do_something() in your code, which is the reason of the error. Commented May 20, 2022 at 18:14