Prevent changing Reference<> address
Reactor's Reference<> class represents a C++-like reference. It can be
constructed from another reference, which creates a shallow copy, or it
can be assigned another reference, which is a deep copy, but it cannot
be assigned a new address. To enforce this, the address field was made
constant.
Also the default copy constructor outside the class definition, which is
considered a user-provided copy constructor, was replaced with an in
class defaulted default copy constructor. This makes it easier to
understand that the copy constructor does default copying of the member
fields when only looking at the class definition, takes fewer lines of
code, and may enable some optimizations.
Bug: b/191417833
Change-Id: Ied4ba3c7957b36efc06c19ce49f4e26309fb0c66
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/55029
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by:
Nicolas Capens <nicolascapens@google.com>
Reviewed-by:
Alexis Hétu <sugoi@google.com>
Showing
Please
register
or
sign in
to comment