Skip to content

Commit 963302b

Browse files
Implement assignment operator for qvi_bbuff. (#271)
Signed-off-by: Samuel K. Gutierrez <[email protected]>
1 parent 1103ce8 commit 963302b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/qvi-bbuff.cc

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ qvi_bbuff::~qvi_bbuff(void)
3737
if (m_data) free(m_data);
3838
}
3939

40+
void
41+
qvi_bbuff::operator=(
42+
const qvi_bbuff &src
43+
) {
44+
const int rc = append(src.m_data, src.m_size);
45+
if (qvi_unlikely(rc != QV_SUCCESS)) throw qvi_runtime_error();
46+
}
47+
4048
size_t
4149
qvi_bbuff::size(void) const
4250
{

src/qvi-bbuff.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct qvi_bbuff {
4242
~qvi_bbuff(void);
4343
/** Assignment operator. */
4444
void
45-
operator=(const qvi_bbuff &src) = delete;
45+
operator=(const qvi_bbuff &src);
4646
/** Returns the size of the data stored in the byte buffer. */
4747
size_t
4848
size(void) const;

0 commit comments

Comments
 (0)