title: Using C++ template as return type/variable name
body: <p>I'm trying to use the template <code>StaticJsonDocument</code> from the arduino-json library in a function and return it, but I can't figure out what exactly I'm supposed to write into the return type's argument list.. everything i tried gets rejected as invalid.</p>
  
  <pre><code>StaticJsonDocument&lt;???&gt; toJson(char* c) {
  
    StaticJsonDocument&lt;256&gt; doc;
    deserializeJson(doc, c);
  
    return doc;
  }
  </code></pre>
  
  <p>Definition of <code>StaticJsonDocument</code>from Github:</p>
  
  <pre><code>#pragma once
  
  #include "JsonDocument.hpp"
  
  namespace ARDUINOJSON_NAMESPACE {
  
  template &lt;size_t desiredCapacity&gt;
  class StaticJsonDocument : public JsonDocument {
    static const size_t _capacity =
        AddPadding&lt;Max&lt;1, desiredCapacity&gt;::value&gt;::value;
  
   public:
    StaticJsonDocument() : JsonDocument(_buffer, _capacity) {}
  
    StaticJsonDocument(const StaticJsonDocument&amp; src)
        : JsonDocument(_buffer, _capacity) {
      set(src);
    }
  
    template &lt;typename T&gt;
    StaticJsonDocument(const T&amp; src,
                       typename enable_if&lt;IsVisitable&lt;T&gt;::value&gt;::type* = 0)
        : JsonDocument(_buffer, _capacity) {
      set(src);
    }
  
    // disambiguate
    StaticJsonDocument(VariantRef src) : JsonDocument(_buffer, _capacity) {
      set(src);
    }
  
    StaticJsonDocument operator=(const StaticJsonDocument&amp; src) {
      set(src);
      return *this;
    }
  
    template &lt;typename T&gt;
    StaticJsonDocument operator=(const T&amp; src) {
      set(src);
      return *this;
    }
  
   private:
    char _buffer[_capacity];
  };
  
  }  // namespace ARDUINOJSON_NAMESPACE
  </code></pre>