mirror of
https://github.com/boostorg/exception.git
synced 2025-07-20 16:02:06 +02:00
Fixed unqualified use of size_t in object_hex_dump.hpp
[SVN r57668]
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
#include <ios>
|
#include <ios>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
boost
|
boost
|
||||||
@ -21,11 +22,11 @@ boost
|
|||||||
template <class T>
|
template <class T>
|
||||||
inline
|
inline
|
||||||
std::string
|
std::string
|
||||||
object_hex_dump( T const & x, size_t max_size=16 )
|
object_hex_dump( T const & x, std::size_t max_size=16 )
|
||||||
{
|
{
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
s << "type: " << type_name<T>() << ", size: " << sizeof(T) << ", dump: ";
|
s << "type: " << type_name<T>() << ", size: " << sizeof(T) << ", dump: ";
|
||||||
size_t n=sizeof(T)>max_size?max_size:sizeof(T);
|
std::size_t n=sizeof(T)>max_size?max_size:sizeof(T);
|
||||||
s.fill('0');
|
s.fill('0');
|
||||||
s.width(2);
|
s.width(2);
|
||||||
unsigned char const * b=reinterpret_cast<unsigned char const *>(&x);
|
unsigned char const * b=reinterpret_cast<unsigned char const *>(&x);
|
||||||
|
Reference in New Issue
Block a user