std::map<std::string, GLSpriteBase>
|
| std::string GLSprite *
| | /
v v v
sprites[name].addUser(spr);
^
|
GLSpriteBase::adduser(GLSprite *) But g++ vomits a really nasty stl-wtf kind of error when I'm trying to compile. /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_map.h:
In member function '_Tp& std::map<_Key, _Tp, _Compare, _Alloc>::operator[]
(const _Key&) [with _Key = std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, _Tp = GLSpriteBase, _Compare =
std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char>
> >, _Alloc = std::allocator<std::pair<const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, GLSpriteBase> >]':
glsprite.cpp:105: instantiated from here
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/
stl_map.h:348: error: no matching function for call to
'GLSpriteBase::GLSpriteBase()'
glsprite.cpp:16: note: candidates are: GLSpriteBase::GLSpriteBase(std::string)
glsprite.hpp:48: note: GLSpriteBase::GLSpriteBase(const
GLSpriteBase&)
I'm not even sure what to make of this. Why does it think I want to use the constructor? I think the problem has something to do with me trying to use "sprites[name]" and calling a function in the object it gives me, but I've done the same kind of thing before without a problem. Any ideas? If you need more details let me know, I didn't want to paste too much junk up front, especially with the error messages.