I'm a new at C++ and heared of such powerful technic - templates.

Here are my constructors inside the my class

```
    node(const double f) {
        this->type = FLOAT;
        this->data.f = f;
    }
    node(const int i) {
        this->type = INTEGER;
        this->data.i = i;
    }
    //construct a vector
    node(const vector<int> arr) {
        this->type = LIST;
        for (int i=0; i<arr.size(); ++i) {
            this->data.args.push_back(new node(arr[i]));
        }
    } 
    node(const vector<double> arr) {
        this->type = LIST;
        for (int i=0; i<arr.size(); ++i) {
            this->data.args.push_back(new node(arr[i]));
        }
    } 

```

it helps me to do this kind of things

```
node* obj_i = new node({{1, 0},{0, -1}});
node* obj_f = new node({{1.0, 0.0},{0.0, -1.0}});

```

I did have to write down the initializers twice for the integer and float types of arrays. Is there any way to do it using templates and replace the last two functions with one?

Thanks

**UPD**
I went deeper and declared the constructor of matrixes and got error

```
    //construct a matrix    
    node(const vector<vector<int>> arr) {
        this->type = LIST;
        for (int i=0; i<arr.size(); ++i) {
            this->data.args.push_back(new node(arr[i]));
        }
    } 
    node(const vector<vector<double>> arr) {
        this->type = LIST;
        for (int i=0; i<arr.size(); ++i) {
            this->data.args.push_back(new node(arr[i]));
        }
    }  

```

```
error: call of overloaded 'node(<brace-enclosed initializer list>)' is ambiguous
     node* matrix2 = new node({{0.0,7.7}, {3.3,-9.2}});

```

I seems to be that my technic fundamentally wrong...