Files
CMake/Source
Sebastian Holtermann cdff7f4e2a cmSystemTools: Add ExpandedListArgument and ExpandedLists methods
Changes
-------

In `cmSystemTools` this
- renames the method `ExpandList` to `ExpandLists` and makes it iterator based

and adds the methods
- `std::vector<std::string> ExpandedLists(InputIt first, InputIt last)`
- `std::vector<std::string> ExpandedListArgument(const std::string& arg,
                                                       bool emptyArgs)`

Both return the  `std::vector<std::string>` instead of taking a return vector
reference like `cmSystemTools::ExpandLists` and
`cmSystemTools::ExpandListArgument`.

Motivation
----------

Since C++17 return value optimization is mandatory, so returning a
`std:vector<std::string>` from a function should be (at least) as fast as
passing a return vector reference to the function.

The new methods can replace `cmSystemTools::ExpandLists` and
`cmSystemTools::ExpandListArgument` in many cases, which leads to
shorter and simpler syntax.

E.g. the commonly used pattern
```
  if (const char* value = X->GetProperty("A_KEY_STRING")) {
    std::vector<std::string> valuesList;
    cmSystemTools::ExpandListArgument(value, valuesList);
    for (std::string const& i : valuesList) {
      doSomething(i);
    }
  }
```
becomes
```
  if (const char* value = X->GetProperty("A_KEY_STRING")) {
    for (std::string const& i :
      cmSystemTools::ExpandedListArgument(value)) {
      doSomething(i);
    }
  }
```
2019-05-13 15:37:18 +02:00
..
2019-05-03 11:48:46 -04:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2019-03-18 14:18:13 -04:00
2019-03-18 14:18:13 -04:00
2019-04-28 22:45:44 +10:00
2019-05-03 11:48:46 -04:00
2019-05-10 00:01:05 -04:00
2019-04-04 13:24:39 -04:00
2019-01-25 06:44:32 -05:00
2019-03-30 15:34:59 +01:00
2019-01-29 14:09:21 -05:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2019-01-29 14:09:21 -05:00
2019-03-20 11:41:29 -04:00
2019-01-22 13:03:04 -05:00
2019-01-22 13:03:04 -05:00
2019-01-25 06:44:32 -05:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2018-12-12 09:46:13 -05:00
2018-12-12 09:46:13 -05:00
2018-12-12 06:40:10 -05:00
2019-01-29 14:09:21 -05:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2019-03-18 15:09:10 +01:00
2019-01-25 06:44:32 -05:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2019-01-29 14:09:21 -05:00
2019-01-25 06:44:32 -05:00
2018-11-19 23:35:09 +01:00
2019-01-25 06:44:32 -05:00
2019-01-22 13:03:04 -05:00
2019-01-22 13:03:04 -05:00
2019-01-22 13:03:04 -05:00
2019-01-22 13:03:04 -05:00
2019-01-25 06:44:32 -05:00
2019-01-25 06:44:32 -05:00
2019-02-21 08:24:26 -05:00
2019-01-22 13:03:04 -05:00
2019-01-29 14:09:21 -05:00
2019-01-29 14:09:21 -05:00
2019-01-22 13:03:04 -05:00
2019-01-22 13:03:04 -05:00
2019-01-25 06:44:32 -05:00
2019-01-29 14:09:21 -05:00
2019-01-25 06:44:32 -05:00
2019-01-22 13:03:04 -05:00