
What's the size of that vector, anyway? - weinzierl
https://rachelbythebay.com/w/2018/04/26/size/
======
conbandit
Output is:

    
    
      vector<int> v{3} size() 1
      vector<string> v{3} size() 3
      vector<int> v{0} size() 1
      terminate called after throwing an instance of 
      'std::logic_error'
        what():  basic_string::_M_construct null not valid
      Aborted (core dumped)
    

Can anyone explain why there's a logic error?

~~~
clord
I'd guess it chooses the implicit string(const char*) constructor and then
feeds it a nullptr. I think the plan is to get rid of this in the future with
the new nullptr_t/nullptr mechanism, but for now we're stuck with it.

~~~
steveklabnik
that's what /r/cpp says it is

------
pmarin
Is not suspicious that this Blog [1] has a new entry in the front page _every
single day for weeks_ or I am just paranoid?

[1]
[https://news.ycombinator.com/from?site=rachelbythebay.com](https://news.ycombinator.com/from?site=rachelbythebay.com)

~~~
sp332
She's really just that prolific. She just started updating the blog again
recently
[https://rachelbythebay.com/w/2018/03/10/free/](https://rachelbythebay.com/w/2018/03/10/free/)
and she might have had some topics ready to go. But even back in 2013, it
wasn't uncommon for her to have several posts per week.
[https://rachelbythebay.com/w/](https://rachelbythebay.com/w/)

