title: Is it acceptable to not include all function declarations in the header to create a "private namespace"?
body: <p>I've been writing some code for a while now. I've been using namespaces to separate a few parts of code to make the code more readable. However, I ran into a problem where I wanted to make something in that private. Here's what I found works:</p>
  
  <pre><code>//foobar.h
  namespace foo_bar {
    //Other items here...
  }
  </code></pre>
  
  
  
  <pre><code>//foobar.cpp
  namespace foo_bar {
    //Other items here...
    void foo_barz() {..
      //Faked private method!
    }
  }
  </code></pre>
  
  <p>It compiled fine. Is there any negative to using this method? I think a class might have been a better choice for this, but using a namespace, at the time, seemed like a simpler solution because it was all one project. Is there a more "conventional" way to do this? Is this likely to cause other issues down the road? What might some issues with this be?</p>
  
  <p><strong>EDIT:</strong> I guess I wasn't clear what I did. What I did was this: I didn't include the function prototype in the header file, so when included, the header file makes the code which the file was included into think that the function doesn't exist.</p>