mirror of
https://github.com/qpdf/qpdf.git
synced 2024-11-05 21:07:50 +00:00
4f24617e1e
Where not possible, use "auto" to get the iterator type. Editorial note: I have avoid this change for a long time because of not wanting to make gratuitous changes to version history, which can obscure when certain changes were made, but with having recently touched every single file to apply automatic code formatting and with making several broad changes to the API, I decided it was time to take the plunge and get rid of the older (pre-C++11) verbose iterator syntax. The new code is just easier to read and understand, and in many cases, it will be more effecient as fewer temporary copies are being made. m-holger, if you're reading, you can see that I've finally come around. :-)
31 lines
607 B
C++
31 lines
607 B
C++
#include <qpdf/QUtil.hh>
|
|
#include <iostream>
|
|
|
|
static void
|
|
test_numrange(char const* range)
|
|
{
|
|
if (range == 0) {
|
|
std::cout << "null" << std::endl;
|
|
} else {
|
|
std::vector<int> result = QUtil::parse_numrange(range, 15);
|
|
std::cout << "numeric range " << range << " ->";
|
|
for (int i: result) {
|
|
std::cout << " " << i;
|
|
}
|
|
std::cout << std::endl;
|
|
}
|
|
}
|
|
|
|
int
|
|
main(int argc, char* argv[])
|
|
{
|
|
try {
|
|
test_numrange(argv[1]);
|
|
} catch (std::exception& e) {
|
|
std::cout << e.what() << std::endl;
|
|
return 2;
|
|
}
|
|
|
|
return 0;
|
|
}
|