KWSys 2020-03-04 (6af2e592)

Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 6af2e59217a7e10ed507da564a1445b60ac2a095 (master).

Upstream Shortlog
-----------------

Hans Johnson (17):
      81d1e737 STYLE: Use modern path naming
      28b8e6c2 STYLE: Convert CMake-language commands to lower case
      6ce3d69a DOC: Update documentation for modern add_subdirectory.
      8a7fe7ac STYLE: Remove redundant void argument lists
      1c3e193d COMP: Use nullptr instead of 0 or NULL
      2a4c1252 STYLE: Replace integer literals which are cast to bool.
      0fe7214d STYLE: Make prototype match definition names
      3b30d0ff STYLE: Make prototype match definition names
      691d5612 PERF: readability container size empty
      7be4043f STYLE: Prefer c++11 'using' to 'typedef'
      acc916ed COMP: Prefer const pointer when value does not change
      4c7f64eb COMP: Prefer const member functions
      d07092a0 STYLE: Use default member initialization
      6d20e7c9 STYLE: Prefer = default to explicitly trivial implementations
      91429382 PERF: emplace_back method results in potentially more efficient code
      cc8fc323 STYLE: Use auto for variable type matches the type of the initializer
      6621b069 STYLE: Use range-based loops from C++11

Julien Schueller (1):
      a1a261ac CMake: Fix psapi lib name on case-sensitive fs
This commit is contained in:
KWSys Upstream
2020-03-04 07:59:29 -05:00
committed by Brad King
parent 4e8c4c7ebe
commit ec33e3600c
19 changed files with 999 additions and 968 deletions
+8 -8
View File
@@ -27,30 +27,30 @@ template class kwsys::hash_set<int>;
static bool test_hash_map()
{
typedef kwsys::hash_map<const char*, int> mtype;
using mtype = kwsys::hash_map<const char*, int>;
mtype m;
const char* keys[] = { "hello", "world" };
m[keys[0]] = 1;
m.insert(mtype::value_type(keys[1], 2));
int sum = 0;
for (mtype::iterator mi = m.begin(); mi != m.end(); ++mi) {
std::cout << "Found entry [" << mi->first << "," << mi->second << "]"
for (auto& mi : m) {
std::cout << "Found entry [" << mi.first << "," << mi.second << "]"
<< std::endl;
sum += mi->second;
sum += mi.second;
}
return sum == 3;
}
static bool test_hash_set()
{
typedef kwsys::hash_set<int> stype;
using stype = kwsys::hash_set<int>;
stype s;
s.insert(1);
s.insert(2);
int sum = 0;
for (stype::iterator si = s.begin(); si != s.end(); ++si) {
std::cout << "Found entry [" << *si << "]" << std::endl;
sum += *si;
for (int si : s) {
std::cout << "Found entry [" << si << "]" << std::endl;
sum += si;
}
return sum == 3;
}