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,047 of 33,346    |
|    SG to Daryle Walker    |
|    Re: Yikes! We forgot to encode an iterac    |
|    16 May 13 10:02:08    |
   
   d5bcbd58   
   From: s.gesemann@googlemail.com   
      
   On May 16, 3:03 pm, Daryle Walker wrote:   
   > [...] we can do this:   
   > [...]   
   > channel C++ varargs into C varargs. But how do we go the other way?   
   > How do we use the va_* stuff for C varargs when the next-to-last   
   > argument is a C++ vararg? My limited testing concludes that it DOES   
   > NOT work.   
      
   It can't work. The type information is already lost and only available   
   at runtime as part of the format string (assuming the programmer did   
   not make a type error). That's just too late to feed a variadic   
   function template -- unless you want the compiler to create a LOT of   
   function template instances in advance for every possible situation   
   you *could* run into at *runtime* up to a certain maximum number of   
   parameters. But that would be incredibly wasteful ("template bloat   
   explosion").   
      
   SG   
      
      
   --   
    [ 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