David, I'm puzzled about missing std::

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

David, I'm puzzled about missing std::

Paul Licameli
I see in David Bailes' recent changes that there are uses of std::find_if but the std:: qualifier is left out and still it compiles.

I don't see where there was
using namespace std;
to make that possible.

I don't like using namespace directives at file scope -- they defeat the point of namespaces.  I prefer to write std::, unless I repeat it very often in one expression, and then I might add using namespace std; in a small local scope.

And by the way, I might write those with std::lower_bound instead, but not that the log time matters very much.

PRL


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: David, I'm puzzled about missing std::

David Bailes-3
On Mon, Apr 3, 2017 at 5:13 PM, Paul Licameli <[hidden email]> wrote:
I see in David Bailes' recent changes that there are uses of std::find_if but the std:: qualifier is left out and still it compiles.

I don't see where there was
using namespace std;
to make that possible.

I'm puzzled as well. 

I don't like using namespace directives at file scope -- they defeat the point of namespaces.  I prefer to write std::, unless I repeat it very often in one expression, and then I might add using namespace std; in a small local scope.

I've added std:: prefix to my uses of find_if. 

And by the way, I might write those with std::lower_bound instead, but not that the log time matters very much.

Given the likely number of clips in a track, I see no reason to optimize this,

David.
 

PRL


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: David, I'm puzzled about missing std::

Paul Licameli
I should have thought of this explanation:

The call works, as it should, without std::qualification because the types of the iterators also belong to namespace std.

PRL


On Tue, Apr 4, 2017 at 7:47 AM, David Bailes <[hidden email]> wrote:
On Mon, Apr 3, 2017 at 5:13 PM, Paul Licameli <[hidden email]> wrote:
I see in David Bailes' recent changes that there are uses of std::find_if but the std:: qualifier is left out and still it compiles.

I don't see where there was
using namespace std;
to make that possible.

I'm puzzled as well. 

I don't like using namespace directives at file scope -- they defeat the point of namespaces.  I prefer to write std::, unless I repeat it very often in one expression, and then I might add using namespace std; in a small local scope.

I've added std:: prefix to my uses of find_if. 

And by the way, I might write those with std::lower_bound instead, but not that the log time matters very much.

Given the likely number of clips in a track, I see no reason to optimize this,

David.
 

PRL


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Loading...