Hi Yoshimi-developers,
this is a mater of style, or taste, something we might want to discuss
when Will is back from holiday.
The Clang folks introduced a new warning this spring,
which now starts to show up on our code when using new compilers.
https://sourceforge.net/p/yoshimi/bugs/38/
It is triggered when the free function std::move is properly imported
into some header, and then used unqualified somewhere in the code.
Personally, I find especially introducing this warning as somewhat upsetting,
because there was no wildcard import ("using namespace std"), and moreover
RValue references and move semantics are a hallmark of modern C++ since more
than 10 years, and it is not even permitted by the standard to provide your
own specialisation of std::move and std::forward (other than for std::swap,
where it is common to provide a custom optimised specialisation for your
own classes).
Of course I can see that this warning may provide a good hint for total
beginners. Unfortunately, there is still the bad habit in introductory
courses to teach using wildcart imports for their very first programs,
since at that point the concept of namespaces has not yet been introduced
and might be quite a stretch for someone fighting even to get basic
syntax right. Thus unfortunately many beginners stick to the habit
of writing "using namespace std" into every source code file.
Add to this the observation that many occasional users of C++ do not
even understand the difference between value semantics and reference
semantics clearly, since many modern "easygoning" languages have a
garbage collector, allocate everything to the heap and only allow
to refer to objects by reference. Such an occasional user will
lack the foundations to understand the point in move semantics,
and might then end up inventing a function "move()" for something
completely unrelated, and be totally bewildered that instead some
ominous function "move" from the standard library is invoked....
So I see there is a point in including such a warning into the
default configuration of compilers to support total beginners.
But IMHO Yoshimi is not a "beginner code base" anyway.
Thus we have the following options:
- add a -Wno-unqualified-std-cast-call to our build configuration
to disable the new warning and retain the status-quo
- or require to qualify each call to std::move or std::forward to
be qualified from now on, even if this hampers legibility, does not
add any useful information and does not address any real concern.
-- Hermann
_______________________________________________
Yoshimi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel