This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

basic_string::_S_construct


Hello,
I am very surprised that _S_construct signature for forward_iterator_tag 
and input_iterator_tag have been removed.
As a result
	std::ifstream ifs("some.file");
	std::string s(std::istreambuf_iterator<char>(ifs), 
		      std::istreambuf_iterator<char>());
always results in empty string.

And one more thing  
in 
	basic_string::_S_construct(_InIter __beg, _InIter __end, 
		const _Alloc& __a)
line
	__range > 0 ? __range : -1 * __range;
does nothing - obviously a typo - but what is supposed reaction for a 
invalid range? 
Currently it throws length_error from _Rep::_S_create
because static_cast<size_type>(__range) > _Rep::_S_max_size 
Is it guaranteed?


-- 
*********************************************
Vadim Egorov, 1C      *       Вадим Егоров,1C
egorovv@1c.ru         *         egorovv@1c.ru
*********************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]