user47801: I am using Arduino 1.8.5 ide. I am just creating a class with two typename which name is "Map". This class takes all int and String variations. Like;
class Map<int, int>;
class Map<int, String>;
class Map<String, int>;
class Map<String, String>;


Map<int, String> *list = new Map<int, String>();

If I create instance of this class like above in Main.ino file then everything is ok. But if I create it another file with .h extension which is "Test.h" then compilation fails. These are files;
    Main.ino
#include "Map.h"
#include "Test.h"

Test *test = new Test();
Map<int, String> *list = new Map<int, String>();


void setup() {

}

void loop() {

}

Map.cpp
#include "Arduino.h"
#include "Map.h"

template<typename E, typename T> Map<E, T>::Map()
{

}


template class Map<int, int>;
template class Map<int, String>;
template class Map<String, int>;
template class Map<String, String>;

Map.h
#ifndef Map_h
#define Map_h

#include "Arduino.h"

template<typename E, typename T> class Map {

public:
    Map();
    ~Map();
};

#endif

Test.h
#ifndef _Test_h
#define _Test_h


#include "Arduino.h"
#include "Map.h"

class Test
{
public :
    Test();
    ~Test();
    Map<int, String> *list = new Map<int, String>();
};

#endif

Error is;
In file included from C:\Users\zafer\Desktop\Main\Main.ino:3:0:
Test.h:14: error: expected ';' at end of member declaration
  Map<int, String> *list = new Map<int, String>();

                                        ^

Test.h:14: error: expected unqualified-id before '>' token
  Map<int, String> *list = new Map<int, String>();

                                              ^

Test.h:14: error: wrong number of template arguments (1, should be 2)
  Map<int, String> *list = new Map<int, String>();

                                   ^

In file included from C:\Users\zafer\Desktop\Main\Main.ino:2:0:
Map.h:6: error: provided for 'template<class E, class T> class Map'
 template<typename E, typename T> class Map {

                                        ^
exit status 1
expected ';' at end of member declaration

Sorry, If it's been already resolved and I couldn't find it.
Thank you.

user10794: In this class declaration:
class Test
{
public :
    Test();
    ~Test();
    Map<int, String> *list = new Map<int, String>();
};

This line is wrong:
    Map<int, String> *list = new Map<int, String>();

You can't execute procedural code when declaring a class. That has to go into the constructor or some other function.
For example, this compiles without errors:
Test.h
#ifndef _Test_h
#define _Test_h


#include "Arduino.h"
#include "Map.h"

class Test
{
public :
    Test() { list = new Map<int, String>; } ;
    ~Test();
    Map<int, String> *list;
};

#endif


47801: <p>I am using Arduino 1.8.5 ide. I am just creating a class with two typename which name is "Map". This class takes all int and String variations. Like;</p>

<pre><code>class Map&lt;int, int&gt;;
class Map&lt;int, String&gt;;
class Map&lt;String, int&gt;;
class Map&lt;String, String&gt;;


Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();
</code></pre>

<p>If I create instance of this class like above in Main.ino file then everything is ok. But if I create it another file with .h extension which is "Test.h" then compilation fails. These are files;</p>

<h2>    Main.ino</h2>

<pre><code>#include "Map.h"
#include "Test.h"

Test *test = new Test();
Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();


void setup() {

}

void loop() {

}
</code></pre>

<h2>Map.cpp</h2>

<pre><code>#include "Arduino.h"
#include "Map.h"

template&lt;typename E, typename T&gt; Map&lt;E, T&gt;::Map()
{

}


template class Map&lt;int, int&gt;;
template class Map&lt;int, String&gt;;
template class Map&lt;String, int&gt;;
template class Map&lt;String, String&gt;;
</code></pre>

<h2>Map.h</h2>

<pre><code>#ifndef Map_h
#define Map_h

#include "Arduino.h"

template&lt;typename E, typename T&gt; class Map {

public:
    Map();
    ~Map();
};

#endif
</code></pre>

<h2>Test.h</h2>

<pre><code>#ifndef _Test_h
#define _Test_h


#include "Arduino.h"
#include "Map.h"

class Test
{
public :
    Test();
    ~Test();
    Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();
};

#endif
</code></pre>

<p>Error is;</p>

<pre><code>In file included from C:\Users\zafer\Desktop\Main\Main.ino:3:0:
Test.h:14: error: expected ';' at end of member declaration
  Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();

                                        ^

Test.h:14: error: expected unqualified-id before '&gt;' token
  Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();

                                              ^

Test.h:14: error: wrong number of template arguments (1, should be 2)
  Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();

                                   ^

In file included from C:\Users\zafer\Desktop\Main\Main.ino:2:0:
Map.h:6: error: provided for 'template&lt;class E, class T&gt; class Map'
 template&lt;typename E, typename T&gt; class Map {

                                        ^
exit status 1
expected ';' at end of member declaration
</code></pre>

<p>Sorry, If it's been already resolved and I couldn't find it.</p>

<p>Thank you.</p>
 10794: <p>In this class declaration:</p>

<pre><code>class Test
{
public :
    Test();
    ~Test();
    Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();
};
</code></pre>

<p>This line is wrong:</p>

<pre><code>    Map&lt;int, String&gt; *list = new Map&lt;int, String&gt;();
</code></pre>

<p>You can't execute procedural code when declaring a class. That has to go into the constructor or some other function.</p>

<p>For example, this compiles without errors:</p>

<h2>Test.h</h2>

<pre><code>#ifndef _Test_h
#define _Test_h


#include "Arduino.h"
#include "Map.h"

class Test
{
public :
    Test() { list = new Map&lt;int, String&gt;; } ;
    ~Test();
    Map&lt;int, String&gt; *list;
};

#endif
</code></pre>
