title: Meaning of multiple definitions for inline or constexpr function
body: <p>This is my knowledge about function declaration and definition. If there is anything wrong, please correct me.</p>
  
  <pre><code>// Function Declaration
  // This is usually put in .h header file
  int occur (const char* sentence, const char&amp; achar);
  
  // Function Definition
  // This is usually put in .cpp
  int occur (const char* sentence, const char&amp; achar) { // do job and return }
  </code></pre>
  
  <p>I am reading the "C++ Primer 5th Edition". Under "inline and constexpr functions @ Chapter 6.5.2 P.240", it says</p>
  
  <blockquote>
    <p>Unlike other functions, inline and constexpr functions may be defined
    multiple times in the program.</p>
  </blockquote>
  
  <p>I come up with something like this in my head:</p>
  
  <pre><code>// function delcaration .h file
  constexpr int returnfour();
  
  // function definition in .cpp file
  constexpr int returnfour () { return 4; }
  constexpr int returnfour () { return 4; }
  </code></pre>
  
  <p>Is it correct to have multiple definitions like this? What does <code>defined multiple times in the program</code> mean and when does someone want to do it?</p>