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,586 of 33,346   
   rogeeva@googlemail.com to All   
   Re: why std::vector&& is not a univer   
   10 Oct 12 01:50:08   
   
   { Please limit your text to fit within 80 columns, preferably around 70,   
     so that readers don't have to scroll horizontally to read each line.   
     This article has been reformatted manually by the moderator. -mod }   
      
   On Tuesday, October 9, 2012 12:30:03 AM UTC-4, Daniel Krügler wrote:   
   > The usual technique is to specify a function of the form T&& and to   
   > constrain it accordingly. E.g.   
      
   I have another related question. Let's say all my templates are in   
   namespace myns and I want to implement operator+ for them following   
   above guideline:   
      
   namespace myns {   
   ... // my types here   
      
   template   
   my_result_type   
   operator+( T1&& arg1, T2&& arg2 )   
   {   
      ...   
   }   
      
   } // namespace myns   
      
   An intention here is to implement an operator+ for types in my   
   namespace. Now the question is: do I really need to add enable_if   
   constrain (constraining by some trait identifying my types) or I can   
   rely on ADL to do his for me (let's also assume I never intend to use   
   "using namespace myns" in the code anywhere)?   
      
   Thank you.   
   Gennadiy   
      
      
   --   
         [ 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