Page MenuHomePhabricator

Make Amount trivially copyable
ClosedPublic

Authored by PiRK on Mar 10 2023, 12:50.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCbc4e81898f79: Make Amount trivially copyable
Summary

There is no need for a user-provided copy constructor in Amount. Removing it makes the class trivially-copyable, which allows to use std::atomic<Amount>.

See https://en.cppreference.com/w/cpp/language/classes#Trivially_copyable_class

Remove also the assignement operator operator=( which was only defined to remove a deprecation warning for implicit assignement operators with explicit copy-constructors (D3963)

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mar 10 2023, 12:50
This revision is now accepted and ready to land.Mar 10 2023, 14:24
This revision was automatically updated to reflect the committed changes.