From: Keith.S.Thompson+u@gmail.com   
      
   David Brown writes:   
   [...]   
   > How many people do you know who have actually written and use a   
   > C11 print system using _Generic and variadic macros? I don't know   
   > any. (I've written simple examples as proofs of concept, posted   
   > in this group, but not for real use.) It turns out that people   
   > /don't/ have to have workarounds. "printf" has its limitations -   
   > there's no doubt there. But it is good enough for most people   
   > and most uses.   
      
   I recently played around with an attempted framework using _Generic.   
   The goal was to be able to write something like   
      
    print(s(x), s(y), s(z));   
      
   where x, y, and z can be of more or less arbitrary types (integer,   
   floating-point char*). The problem I ran into was that only one of   
   the generic associations is evaluated (which one is determined at   
   compile time), but *all* of them have to be valid code. There's a   
   proposal to change this for C 202y.   
      
   I didn't spend a lot of time on it.   
      
   --   
   Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com   
   void Void(void) { Void(); } /* The recursive call of the void */   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|