New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace STL-like containers by their STL counterparts #890
Conversation
MSConcat is making use of simpleOrderedMap a lot. Did you already look at that? |
OK, I looked at your changes to MSConcat and you definitely did look at it. :) |
Less code to maintain and most likely better performance (certainly support
of move semantics).
I noticed, however, that one test (tRowCopier) failed with gcc-4.8, so I
have to look into that problem.
getMapValue is doing something special by returning -1 if not find.
std::map has the functions 'at' and 'find' to lookup a key. Operator[] only
works on non-const maps (unlike the Casacore Maps). I very much like that I
can now use 'for (const auto& x : myMap)'
BTW. An advantage of the Casacore Map classes was the support of a default
value that is used when a new key is defined. It made something like:
if (value > map[key]) map[key]=value;
possible if a default value of e.g. min_int was used. std::map always has
T() as the default, so in such a case you first have to test if the key
exists.
Also note the somewhat unexpected behaviour of std::map::define which
doesn't do anything (apart from returning a reference to the value) when an
existing key with a new value is defined. No exception and no value
replacement. There is quite some discussion on stackoverflow.
…On Mon, Apr 1, 2019 at 5:28 PM Dirk Petry ***@***.***> wrote:
OK, I looked at your changes to MSConcat and you definitely did look at
it. :)
Question: you had to define an inline function getMapValue(). Is not even
this simple functionality provided by the STL map? I am wondering why we
are abandoning the CASA simpleOrderedMap if the STP version offers so few
features ...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#890 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHfIPI7J-W1FfAQNMFHynbKJmrGw9bOPks5vciWwgaJpZM4cVgVx>
.
|
Darrell Schiebel has built and tested the CASA package using this PR. All rests pass, so it can be merged. |
I tried to use this flag in 3.1.2 and I got:
|
Try with |
I am facing the same issue while compiling casarest with casacore 3.2.1. I tried casarest master and 1.5.0. Following the comments above, I tried using the branch useSTL and it fails with a different error: [ 29%] Building CXX object msvis/CMakeFiles/casa_msvis.dir/MSVis/CalVisBuffer.cc.o |
I believe ROMSColumns has been removed. MSColumns should be used even for read-only usage. |
Workaround with |
Classes Map (and variations), List, Queue and Stack have been replaced by their STL counterparts.
These Casacore classes are not built/installed anymore unless -DBUILD_DEPRECATED is given to cmake.
Close #118