title: Template function related compile error
body: <p>I'm working on a piece of code and have been banging my head against the proverbial wall for quite some time now. I am kind of new to the whole concept of templates and so would appreciate any and all help I can get on the following problem:</p>
  
  <p>I am trying to build a object builder that takes an allocator as argument as such:</p>
  
  <pre><code>class Allocator {
  public:
      allocate(unsigned int size, unsigned int alignment);
      template &lt;class T&gt;
      T* allocate_object() { return allocate(sizeof(T), alignof(T)); }
  };
  
  template &lt;class ALLOCATOR&gt;
  class Builder {
  public:
      Builder(ALLOCATOR&amp; a) : a(a) {}
      void build_something() {
          int* i = a.allocate_object&lt;int&gt;();
      }
  private:
      ALLOCATOR&amp; a;
  };
  </code></pre>
  
  <p>When I try to call the 'build_something' function with my allocator i get the following compilation error: <strong>"error: expected primary-expression before 'int'"</strong></p>
  
  <p>The allocator works on its own as intended but can not be used as a template argument as in the example. So, is there something I can do to fix this without having to drop the template function in the allocator?</p>
  
  <p>Preferably I would have liked to use polymorphism to send an allocator (base class) object 
  pointer to the builder but apparently you can't have virtual template functions. :)</p>
  
  <p>Thanks for the time! :)
  -Maigo</p>