Commit 1c66bfcb authored by Guolin Ke's avatar Guolin Ke
Browse files

Add const to BinMapper::CopyTo

parent 716584f4
...@@ -143,7 +143,7 @@ public: ...@@ -143,7 +143,7 @@ public:
* \brief Seirilizing this object to buffer * \brief Seirilizing this object to buffer
* \param buffer The destination * \param buffer The destination
*/ */
void CopyTo(char* buffer); void CopyTo(char* buffer) const;
/*! /*!
* \brief Deserilizing this object from buffer * \brief Deserilizing this object from buffer
......
...@@ -302,7 +302,7 @@ int BinMapper::SizeForSpecificBin(int bin) { ...@@ -302,7 +302,7 @@ int BinMapper::SizeForSpecificBin(int bin) {
return size; return size;
} }
void BinMapper::CopyTo(char * buffer) { void BinMapper::CopyTo(char * buffer) const {
std::memcpy(buffer, &num_bin_, sizeof(num_bin_)); std::memcpy(buffer, &num_bin_, sizeof(num_bin_));
buffer += sizeof(num_bin_); buffer += sizeof(num_bin_);
std::memcpy(buffer, &is_trival_, sizeof(is_trival_)); std::memcpy(buffer, &is_trival_, sizeof(is_trival_));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment