Hi All,

I'm not too familiar with STL map but am trying to implement it to make 
managing a bunch of Fl_Input's a little easier.

I'm trying to compile something along the lines of the below (free typed the 
relevant bits that I've narrowed it down to) but am getting an error:

#include <map>
#include <string>
// Fl includes are here.

class FooWindow : public Fl_Double_Window
{

  // Public decs

   private:
     std::map<std::string, Fl_Input> m_Input;
     typedef std::map<std::string, Fl_Input>::iterator InputItr;

}

FooWindow::FooWindow()
{
        m_Input.insert(std::make_pair<std::string,Fl_Input>("Cat",Fl_Input(140, 
120, 33, 25, "Cat")));
        m_Input.insert(std::make_pair<std::string,Fl_Input>("Dog",Fl_Input(178, 
120, 65, 25, "Dog")));
        m_Input.insert(std::make_pair<std::string,Fl_Input>("Bat",Fl_Input(248, 
120, 130, 25, "Bat")));

}

spews out the error::

c:\program files\microsoft visual studio 10.0\vc\include\map(215): error C2512: 
'Fl_Input::Fl_Input' : no appropriate default constructor available
1>          c:\program files\microsoft visual studio 10.0\vc\include\map(210) : 
while compiling class template member function 'Fl_Input 
&std::map<_Kty,_Ty>::operator [](const std::basic_string<_Elem,_Traits,_Ax> &)'
1>          with
1>          [
1>              _Kty=std::string,
1>              _Ty=Fl_Input,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Ax=std::allocator<char>
1>          ]
1>          c:\documents and settings\xxxx\my documents\visual studio 
2010\projects\creator\foowindow.cpp\foowindow.h(109) : see reference to class 
template instantiation 'std::map<_Kty,_Ty>' being compiled
1>          with
1>          [
1>              _Kty=std::string,
1>              _Ty=Fl_Input
1>          ]

Any help is greatly appreciated!! Thanks
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to