Boost logo

Boost :

Subject: Re: [boost] [date_time] default constructor for period?
From: Scott Bailey (Bailey_at_[hidden])
Date: 2015-05-01 11:55:18


Chris,

Yes, you are right! It wasn't std::deque I had the problem with. In fact,
it was std::map; specifically operator[](). Technically, I could work
around that by using insert() and testing the return value and, if
necessary, calling operator[](). But that's neither very elegant nor
maintainable, in my opinion. Especially when I've yet to see a downside of
adding a default constructor.

Furthermore, I have other other container code that depends on default
constructors. Sure, I could workaround period's lack of default
constructor, but wheres the advantage in that?

SB

On Thu, Apr 30, 2015 at 11:31 AM, Chris Glover <c.d.glover_at_[hidden]> wrote:

> >
> >
> > But std::deque depends on (as does some of my other code) it's type
> having
> > a default constructor. I'm surprised it does not already exists.
> >
> >
> In what situation are you finding the std::deque requires an object to be
> default constructible? As far as I know this is simply not true for any
> std containers so I'd like to know how you've happened upon this.
>
> -- chris
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

-- 
Scott Bailey

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk