Topic: Defect Report: Why does forward_list::resize take the object to be copied by value?
Author: James McNellis <james@jamesmcnellis.com>
Date: Fri, 16 Jul 2010 16:18:29 CST Raw View
In N3092 23.3.3.4 [forwardlist], the resize() member function is
declared as:
void resize(size_type sz, value_type c);
The other sequence containers (list, deque, and vector) take 'c' by
const reference.
Is there a reason for this difference? If not, then resize() should
be declared as:
void resize(size_type sz, const value_type& c);
The declaration would need to be changed both at its declaration in
the class definition at 23.3.3/3 and where its behavior is specified
at 23.3.3.4/22.
Thank you,
James McNellis
--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]