RE: [sigc] How to use sigc::bind<>



> 
> Please do consider not including an API if it can't be done simply. Really,
> who needs to bind more than 1 argument?
> 

I bind multiple arguments quite frequently.  In gtkmail, there's one place 
where I have to bind 5 arguments, and it's quite painful given the
current "only bind two args" usage:


            SigC::Slot5<void,std::string,std::string,std::string,std::string,unsigned int> s5 = 
                SigC::slot(&jlib::net::smtp::send);

            SigC::Slot3<void,std::string,std::string,std::string> s3;

            std::string smtp_server = Config::global.find(m_box->get_name())->get_smtp();

            s3 = SigC::bind(s5,smtp_server,25);

            SigC::Slot1<void,std::string> s1 = SigC::bind(s3,rcpt,m_email.raw());
            SigC::Slot0<void> s0 = SigC::bind(s1,mail);

It would be twice as irritating if I could only bind 1 at a time, and much 
more pleasant if I could bind as many as I needed...

--
joey yandle                   ___====-_  _-====___
www.divisionbyzero.com  _--~~~#####//      \\#####~~~--_
/joey/pubkey.asc     _-~##########// (    ) \\##########~-_
                    -############//  :\^^/:  \\############-
                  _~############//   (@::@)   \\############~_
                 ~#############((     \\//     ))#############~
                -###############\\    (^^)    //###############-
               -#################\\  / "" \  //#################-
              -###################\\/      \//###################-
             _#/:##########/\######(   /\   )######/\##########:\#_
             :/ :#/\#/\#/\/  \#/\##\  :  :  /##/\#/  \/\#/\#/\#: \:
             "  :/  V  V  "   V  \#\: :  : :/#/  V   "  V  V  \:  "
                "   "  "      "   \ : :  : : /   "      "  "   "




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]