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 32,649 of 33,346   
   Scott Prager to Frank Birbacher   
   Re: How to partially specialize class te   
   14 Nov 12 17:02:21   
   
   From: splinterofchaos@googlemail.com   
      
   On Tuesday, November 13, 2012 2:57:32 PM UTC-5, Frank Birbacher wrote:   
      
   > /* For any Monad M the Kleisli is an Arrow. How would I   
   >   
   >  * partially specialize struct Arrow<> for this?   
   >   
   >  */   
   >   
   > // TRIAL 1:   
   >   
   > template class M>   
   >   
   > struct Arrow> { /*...*/ }; // HOW TO?   
      
   ...   
      
   > There seems to be no way to make the syntax "Kleisli" produce a   
   >   
   > template template class argument for Arrow.   
      
   I have to wonder why you want to specialize for M, but not the other   
   parameters. For that matter, why specialize for M? Wouldn't you prefer   
   to just write this?   
      
   struct Arrow { /*...* };   
      
      
   > template class m, typename B, typename C>   
   >   
   > struct Arrow> { /*...*/ };   
      
   This is pretty much what I did in implementing Arrow, too.   
      
   > Any alternatives?   
      
   I don't understand. Doesn't this do exactly what you want? In fact, isn't it   
   best? You'll already know some of the types for the internal functions, so   
   you'll have less template bloat. (In terms of number of lines of code.)   
      
   Although, omitting the practicality of how to write Arrow, I have been   
   pondering   
   whether or not one can partially apply type-arguments, too, like how a function   
   can be partially applied arguments with std::bind.   
      
      
   --   
         [ 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