# TMap with Int\_t

**URL:** <https://root-forum.cern.ch/t/tmap-with-int-t/49046>\
**Category:** Newbie\
**Created:** [March 5, 2022, 10:10am UTC](https://root-forum.cern.ch/t/tmap-with-int-t/49046 "2022-03-05T10:10:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![acgc99](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/a9a28c/32.png) [@acgc99](https://root-forum.cern.ch/u/acgc99)\
**Post date:** [March 5, 2022, 10:10am UTC](https://root-forum.cern.ch/t/tmap-with-int-t/49046/1 "2022-03-05T10:10:50Z")

</div>

Hi,  
It is the first time I use `TMap`, so I’m not sure if I’m using it properly or is better to use `std::map`.

The question is that if I do:

```auto
	TMap* map = new TMap();
	
	map->Add("R", 3);

```

I get:

```auto
In file included from input_line_9:1:
/mnt/d/Sync1/Estudios/IFICCSIC/JAEICUIFIC2122/MadGraph/Project2/pp2ttbarllbar_SMEFTsim_analysis/xs_param.c:54:7: error: no matching member function for call to 'Add'
        map->Add("R", 3);
        ~~~~~^~~
/mnt/d/Debian/ROOT/ROOT6.24.06/include/TMap.h:61:22: note: candidate function not viable: no known conversion from 'const char [2]' to 'TObject *' for 1st argument
   void Add(TObject *key, TObject *value);
                     ^
/mnt/d/Debian/ROOT/ROOT6.24.06/include/TMap.h:60:22: note: candidate function not viable: requires single argument 'obj', but 2 arguments were provided
   void Add(TObject *obj);
                     ^

```

The thing is that `"R"` and `3` are not `TObjetc` but I would like to use them in a dictionary/map.

* * *

ROOT Version:ROOT 6.24/06  
_Platform:_ Debian, Windows Subsystem for Linux  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 5, 2022, 11:41am UTC](https://root-forum.cern.ch/t/tmap-with-int-t/49046/2 "2022-03-05T11:41:26Z")

</div>

[TMap](https://root.cern/doc/master/classTMap.html) is not a replacement for [std::map](https://en.cppreference.com/w/cpp/container/map).
