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,857 of 33,346   
   =?UTF-8?Q?Tobias=20M=C3=BCller?= to Seungbeom Kim   
   Re: Surprising behaviour of c++11 vector   
   10 Feb 13 09:06:39   
   
   -september.org> 32629b2f   
   From: troplin@bluewin.ch   
      
   Seungbeom Kim  wrote:   
   > I'm afraid I don't see what's going on here.   
      
   The range constructor probably looks like:   
      
   template    
   template    
   std::vector::vector(It begin, It end)   
   {   
      for (It it = begin; it != end; ++it)   
      {   
         Alloc::construct(internalBufferPointer, *it);   
         internalBufferPointer += sizeof A;   
      }   
   }   
      
   > Why does the range constructor for v1 produce fatal behavior at   
   > run-time,   
      
   for (const char* it = "abc"; it != "def"; ++it)   
   {/.../}   
      
   > and why does it not when A::A(char const *) is explicit?   
      
   In C++03:   
   void construct ( pointer p, const_reference val );   
      
   > And why does the initialization of v2 fail to compile?   
      
      
   --   
         [ 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