title: Namespace Functions within Class alternatives?
body: <p>I'd like to be able to group similar functions in a class into a group so I don't need to append each name with what it's about. </p>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/13484387/why-cant-we-declare-a-namespace-within-a-class">this question</a> which says that you can't have namespaces within classes. I've also seen <a href="https://stackoverflow.com/questions/13273873/what-is-a-good-alternative-to-namespaces-within-classes">this question</a> which proposes using strongly typed enums. The problem here though, is that I'm not sure whether or not these enums can actually accomodate functions?</p>
  
  <p><strong>The problem contextualised:</strong></p>
  
  <pre><code>class Semaphore
  {
  public:
  
      void Set(bool State){Semaphore = State;}
      bool Get(){return Semaphore;}
      void Wait()
      {
          while (Semaphore)
          {
              //Wait until the node becomes available.
          }
          return;
      }
  private:
      bool Semaphore      = 0;            //Don't operate on the same target simultaneously.
  };
  
  class Node : Semaphore
  {
  public:
      unsigned long IP    = 0;            //IP should be stored in network order.
      bool IsNeighbour    = 0;            //Single hop.
  
      std::vector&lt;int&gt; OpenPorts;
      //Rest of code...
  };
  </code></pre>
  
  <p>Currently, <code>NodeClass.Get()</code> is how I can get the semaphore. However this introduces confusion as to what <code>Get()</code> actually gets. I'd like to have something akin to <code>NodeClass.Semaphore::Get()</code>. Otherwise I'd have to have the functions as <code>SemaphoreSet()</code>, <code>SemaphoreGet()</code>, and <code>SemaphoreWait()</code>, which isn't too well organised or nice looking.</p>
  
  <p>I had thought of just having the <code>Semaphore</code> class on it's own, and instantiating it within the other classes, but if I could stick with the inheritance approach, that would be nicer.</p>
  
  <p>So essentially, <strong>is it possible to access inherited methods like <code>InheritedClass.Group::Function()</code>?</strong></p>