Conversation
|
I'm reading intro to |
| for (auto it = hex_begin; it != hex.end(); ++it) | ||
| { | ||
| const auto h = *it; | ||
| if (std::isspace(h)) |
There was a problem hiding this comment.
Hm why do you want to allow whitespace? If this is to skip extra whitespace from command line, it's better to handle it in command line code.
Also currently it looks to allow "0x12" and " 12" (also "0x 12" and "1 2"), but not " 0x12"
There was a problem hiding this comment.
Yes, this is what I want for simplicity. This is useful for loading hex from files to get rid of line breaks.
There was a problem hiding this comment.
Just hex.erase(std::remove_if(hex.begin(), hex.end()), std::isspace), hex.end()) them!
There was a problem hiding this comment.
This will not work with input iterators (planned change). In the end we can have hex_decoding_iterator and strip_whitespace_iterator but I think having just one is simpler.
lib/hex/hex.cpp
Outdated
| const std::error_category& hex_category() noexcept | ||
| { | ||
| // Create static category object. This involves mutex-protected dynamic initialization. | ||
| // Because of the C++ defect 253, the {} syntax is used. |
There was a problem hiding this comment.
"valarray helper functions are almost entirely useless" ? http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#253
There was a problem hiding this comment.
No description provided.