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,530 of 33,346   
   Ivan Godard to All   
   Re: How to default an undefined operatio   
   05 Sep 12 16:51:30   
   
   From: igodard@pacbell.net   
      
   On 9/5/2012 1:17 PM, Daniel Krügler wrote:   
   > Am 05.09.2012 20:15, schrieb Daniel Krügler:   
   >> There are several approaches possible. E.g. you could define a helper   
   >> traits that evaluates to true, if the expression decltype(U() - U())   
   >> is well-formed. In this case, you use the specialization that computes   
   >> the difference type from this decltype, otherwise you would fallback   
   >> to your version that has a default difference type (or uses other   
   >> means to compute it).   
   >   
   > Here is an example of a possible approach. Within this example I also   
   > branch for scoped enums and return the underlying type instead (It is   
   > important that both specializations are mutually exclusive because none   
   > is more specialized than the other):   
   >   
      
    of *very* helpful example.   
      
   > HTH & Greetings from Bremen,   
   >   
   > - Daniel Krügler   
      
   Wow - this is help well beyond the call of duty! Thank you.   
      
   I think I see what you are doing. However, the usage of   
   "underlying_type" fails for me on g++ 4.6.3; it's not defined in   
   type_traits. Looks like I need to upgrade :-(   
      
   C++11 is still pretty bleeding edge if you actually want to use it.   
      
      
   --   
         [ 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