|
![](/i/fill.gif) |
Warp wrote:
> Edouard <pov### [at] edouard info> wrote:
>> I've seen quite a lot of code in my time that looks like this:
>
>> std::vector< std::string > v1 = someFunction();
>> std::vector< std::string > v2;
>> std::transform( v1.begin(), v1.end, v2.begin(), std::bind1st(
>> std::not_equal_to< std::string >( "" ) ) );
>> for( std::vector< std::string >::iterator i = v2.begin(); i != v2.end();
>> ++i )
>> std::cout << *i << std::endl;
>
>> and I have trouble with it in terms of readability.
>
> Well, I can honestly say that I don't. To me it's perfectly readable,
> and the 'std::' prefixes make it even clearer what is a standard type or
> function and what is a local variable, hence making it *more* readable to
> me than if the prefixes had been omitted.
I agree. Sometimes I found code using std::something where I didn't know the
'something' even existed in the C++ standard. Without the std:: I would have
thought it was a custom function.
Post a reply to this message
|
![](/i/fill.gif) |