On Wed, Nov 13, 2013 at 2:29 AM, Shane Ambler <free...@shaneware.biz> wrote:
> A possible solution I found looking into this is to wrap the Entry
> reference in a std::unique_ptr - so changing -
> std::deque<Entry> messages;
> to -
> std::deque<std::unique_ptr<Entry>> messages;
This "fix" is wrong. (Smart) pointers of T have comparison behaviors
different from T itself, so this may silently change a program's runtime
A better fix is to use `std::deque<std::vector<Entry>>`. Both
libstdc++ and libc++ support vector<Incomplete Type>, and
vector<T>'s comparison behavior is as same as T. And of
course,they both have value semantics.
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
4BSD -- http://4bsd.biz/
email@example.com mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"