No Subject

Nick Burrett n.burrett@btinternet.com
Sat Sep 6 09:41:00 GMT 1997


Is anybody looking into the implementation of explicit template
arguments for G++ ?

Nick B.

Here's a couple of examples:

  // warning: contrived example

  template<class T>
  T* create()
  {
    return new T;
  }

  Foo* f = create<Foo>();
  //              ^^^
  // template argument can't be deduced from (non-existent)
  // function argument list, so supplied explicitly.
  

  // warning: another contrived example
  
  class Bar
  {
    public:
    
      template<class T>
      T* create()
        { return new T; }
  };
  
  Bar b;
  Foo* f = b.template create<Foo>();
  //         ^^^^^^^^
  // note funny looking syntax: the 'dot template'
  // construct.







More information about the Gcc mailing list