Skip to content

Commit

Permalink
Merge pull request #27992 from Dr15Jones/clangFix_bqueue
Browse files Browse the repository at this point in the history
Explicitly declare copy assignment for bqueue
  • Loading branch information
cmsbuild committed Sep 15, 2019
2 parents 0b972d8 + 334cb45 commit 241a280
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions TrackingTools/PatternTools/interface/bqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace cmsutils {
cp.m_size = 0;
}

bqueue &operator=(bqueue<T> const &) = default;
bqueue &operator=(bqueue<T> &&cp) noexcept {
using std::swap;
swap(m_size, cp.m_size);
Expand Down
9 changes: 9 additions & 0 deletions TrackingTools/PatternTools/test/bqueue_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ int main() {
assert(cont.shared());
assert(cont3.shared());
verifySeq(cont3);
// copy assign
{
Cont cont_assign;
cont_assign = cont;
assert(cont.size() == cont_assign.size());
assert(cont.shared());
assert(cont_assign.shared());
verifySeq(cont_assign);
}
// add
cont.push_back(Cont::value_type(new int(10)));
assert((*cont.back()) == 10);
Expand Down

0 comments on commit 241a280

Please sign in to comment.