We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
if i use below code
#include <iostream> #include <vector> #include <iomanip> // For std::hex and std::setw std::ostream& operator<<(std::ostream& out, const std::vector<uint8_t>& v) { for (const auto& val : v) { // Output each value in hexadecimal format, padded with zeros to 2 digits out << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(val) << " "; } return out; } int main() { std::vector<uint8_t> aa {1,2,3}; std::cout << aa; return 0; }
output is
01 02 03
if I use dbg-macro, the output is
#include <iostream> #include <vector> #include <iomanip> // For std::hex and std::setw #include <dbg.h> std::ostream& operator<<(std::ostream& out, const std::vector<uint8_t>& v) { for (const auto& val : v) { // Output each value in hexadecimal format, padded with zeros to 2 digits out << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(val) << " "; } return out; } int main() { std::vector<uint8_t> aa {1,2,3}; dbg(aa); return 0; }
[src\main.cpp:19 (main)] aa = {, , } (std::vector<uint8_t>)
The text was updated successfully, but these errors were encountered:
can use this method
dbg(std::vector<uint32_t> (aa.begin(), aa.end()));
Sorry, something went wrong.
Thank you for reporting this. I'll actually reopen this. Would be great if we could support this out-of the box.
the example code in #137 will solve this problem
No branches or pull requests
if i use below code
output is
if I use dbg-macro, the output is
The text was updated successfully, but these errors were encountered: