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,252 of 33,346   
   Johannes Schaub to All   
   Conditionally make a move_iterator if th   
   06 May 12 13:12:17   
   
   From: schaub.johannes@googlemail.com   
      
   I wonder whether there are begin / end functions (with a suitable   
   name) that do the following   
      
         template   
         auto forward_begin(T &t)   
      -> decltype(begin(t)) {   
           return begin(t);   
         }   
      
         template   
         auto forward_begin(T &&t)   
      -> decltype(std::make_move_iterator(begin(t))) {   
           return std::make_move_iterator(begin(t));   
         }   
      
         template   
         auto forward_end(T &t)   
      -> decltype(end(t)) {   
           return end(t);   
         }   
      
         template   
         auto forward_end(T &&t)   
      -> decltype(std::make_move_iterator(end(t))) {   
           return std::make_move_iterator(end(t));   
         }   
      
   It has occured to me that I think that such a thing could be useful.   
   Does boost or the C++11 spec define such a beast?   
      
      
   --   
         [ 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