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,297 of 33,346   
   Kalle Rutanen to All   
   Grouping parameter packs   
   23 Mar 14 06:25:16   
   
   From: kaba@nowhere.com   
      
   Hi,   
      
   In my understanding, the following is currently not allowed by the C++11   
   standard:   
      
   template    
   void f(A&&... a, B&&... b) {}   
      
   The problem is that the compiler can not know how to group the template   
   arguments into the template parameter packs. For example, using   
   conceptual grouping brackets (not initializer lists), f("key", 0) can be   
   grouped as f({}, {"key", 0}), f({"key"}, {0}), or f({"key", 0}, {}).   
      
   The questions I have are:   
   * is there, with C++14, a way to notify the compiler of the grouping of   
   the template argument packs, as above?   
   * if not, has anyone proposed this idea already?   
   * if not, can you see flaws in this idea?   
   * if not, would you consider it a good idea?   
      
   Here's an example problem: to use perfect forwarding to construct   
   in-place both the key and the value of an associative container.   
      
   Thanks in advance:)   
      
   --   
   http://kaba.hilvi.org   
      
      
   --   
         [ 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