title: Visual C++ error C2665: none of the 3 overloads could convert all the argument types
body: <p>overloaded functions in the structure:</p>
  
  <pre><code>struct VARIABLE
  {
      VARIABLE() : ShortName(NULL), MemberAddr(0), Description(NULL), DefaultValue(NULL), ValueSize(0), MemberType(NULL) {}
  
  
      template&lt;typename U&gt;
      VARIABLE(LPCTSTR sName, U const &amp; member, U const &amp; default, LPCTSTR desc) 
          : ShortName(sName), Description(desc)
          , MemberAddr((LPCBYTE)&amp;member - (LPCBYTE)0), MemberType(new VTYPE&lt;U&gt;()) 
          , SizeAddr(0), SizeType(NULL)
      {
          SetDefault(default);
      }
  
  
      template&lt;typename U&gt;
      VARIABLE(LPCTSTR sName, U const &amp; member, LPCTSTR desc) 
          : ShortName(sName), Description(desc)
          , MemberAddr((LPCBYTE)&amp;member - (LPCBYTE)0), MemberType(new VTYPE&lt;U&gt;()) 
          , SizeAddr(0), SizeType(NULL)
      {}
  
      template&lt;typename T, typename U&gt;
      VARIABLE(LPCTSTR sName, NWArray&lt;U&gt; const &amp; member, T const &amp; size, LPCTSTR desc) 
          : ShortName(sName), Description(desc)
          , MemberAddr((LPCBYTE)&amp;member - (LPCBYTE)0), MemberType(new VTYPE&lt;NWArray&lt;U&gt; &gt;()) 
          , SizeAddr((LPCBYTE)&amp;size - (LPCBYTE)0), SizeType(new VTYPE&lt;T&gt;())
      {}
  
      ~VARIABLE() {
          if (ValueSize &amp;&amp; DefaultValue) {
              delete DefaultValue; DefaultValue = NULL; ValueSize = 0;
          }
          if (MemberType) {
              delete MemberType; MemberType = NULL;
          }
      }
  
      template&lt;typename U&gt; void SetDefault(U default) { ValueSize = sizeof(U); DefaultValue = new U(default); }
      template &lt;typename U&gt; const U&amp; GetDefault() const { return *(U*)DefaultValue; }
  
      LPCTSTR ShortName;
      intptr_t MemberAddr;
      TYPE *MemberType;
      LPCTSTR Description;
      LPVOID DefaultValue;
      DWORD ValueSize;
      DWORD SizeAddr;
      TYPE *SizeType;
  };
  
  #define INITVARTYPE(T) \
      T() { ::Init(this-&gt;GetInfDefmap(), (LPVOID)this); } \
  
  #define BEGIN_INI_MAP_NOINIT(T) \
      LPCSTR GetTypeName() const { return #T; } \
      void *GetMember(const VARIABLE* memptr) const { return (void*)(((char*)this) + memptr-&gt;MemberAddr); } \
      const VARIABLE* GetInfDefmap() const { return InternalGetInfDefmap(); } \
      static VARIABLE* InternalGetInfDefmap() { \
      const T* pThis = 0; static VARIABLE map[] = { \
  
  #define BEGIN_INI_MAP(T) \
      INITVARTYPE(T) \
      BEGIN_INI_MAP_NOINIT(T) \
  
  #define END_INI_MAP() \
      VARIABLE() };\
      return map;} \
  
  template&lt;typename T, typename U, typename V&gt;
  VARIABLE FADDCLASS(T member, U ptr, V desc)
  {
      VARIABLE(member, ptr, desc);
  }
  
  #define ADDCLASS(member) \
      FADDCLASS(#member, pThis-&gt;member, #member), \
  </code></pre>
  
  <p>It gave me this error when it tried to build the following process.</p>
  
  <pre><code>struct test
  {
        char * name;
  
        BEGIN_INI_MAP(test)
          ADDCLASS(name)
        END_INI_MAP()
  }
  </code></pre>
  
  <p>Error C2665: "VARIABLE::VARIABLE" none of the 3 overloads could convert all the argument types.
  How do I solve this?
  I've benn puzzling about this for a couple of hours.</p>