Discussion:
[Audacity-devel] David, I'm puzzled about missing std::
Paul Licameli
2017-04-03 16:13:26 UTC
Permalink
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
David Bailes
2017-04-04 11:47:36 UTC
Permalink
Post by 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'm puzzled as well.
Post by Paul Licameli
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.
Post by Paul Licameli
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.
Post by Paul Licameli
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
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-04-05 15:42:08 UTC
Permalink
I should have thought of this explanation:
http://en.cppreference.com/w/cpp/language/adl

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

PRL
Post by David Bailes
Post by 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'm puzzled as well.
Post by Paul Licameli
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.
Post by Paul Licameli
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.
Post by Paul Licameli
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
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
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Loading...