Salut à tous,

je tente vainement d'utiliser une map ainsi :
Code le .hpp : Sélectionner tout - Visualiser dans une fenêtre à part
std::map<std::string,cStatus> m_status;

Code le .cpp : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
int cElement::AddStatus (std::string name, int nbframes, int visible, int animated, int looping, float x, float y)
{
    cStatus s(name, nbframes, visible, animated, looping, x, y);
    m_status["test"] = s;
    return m_status.size();
}

Et là, il me sort ca à la fin de la compil :
F:\Projets\mi\element.cpp:: In member function `int cElement::AddStatus(std::string, int, int, int, int, float, float)':
F:\Projets\mi\element.cpp:28: error: no match for 'operator[]' in '((cElement*)this)->cElement::m_status["test"]'
C:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\stl_map.h:332: note: candidates are: _Tp& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const _Key&) [with _Key = std::string, _Tp = cStatus, _Compare = std::less<std::string>, _Alloc = std::allocator<std::pair<const std::string, cStatus> >] <near match>
:: === Build finished: 2 errors, 0 warnings ===
Quelqu'un peut-il m'aider ?