POV-Ray : Newsgroups : povray.beta-test : Beta 37 and C++0x : Re: Beta 37 and C++0x Server Time
4 Jul 2024 17:53:29 EDT (-0400)
  Re: Beta 37 and C++0x  
From: Nicolas Alvarez
Date: 4 Jun 2010 13:16:13
Message: <4c0934dd$1@news.povray.org>
Warp wrote:
> Edouard <pov### [at] edouardinfo> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.