home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 33,249 of 33,346   
   Mathias Gaunard to K. Frank   
   Re: What's a good, modern (c++11) argume   
   27 Oct 13 15:40:47   
   
   From: mathias@gaunard.com   
      
   On 25/10/13 01:53, K. Frank wrote:   
   > Hello Group!   
   >   
   > If I am writing a function (or a class) that gets   
   > passed in a user-provided callback function, what   
   > would be a good, general-purpose choice for the   
   > argument type of the callback function?   
   >   
   > Would this be a good use of std::function?   
   >   
   > For example, let's say that my callback function   
   > takes a string and returns a bool.  Would something   
   > like   
   >   
   >     void registerCallback (std::function &cb);   
      
   It should be   
           void registerCallback (std::function   
   const &cb);   
      
   As said earlier, if you don't need to store that object, just use   
   templates instead.   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca