Skip to content
Snippets Groups Projects
Commit efd83570 authored by fearlessTobi's avatar fearlessTobi
Browse files

Make bitfield assignment operator public

This change needs to be made to get the code compiling again. It was suggested after a conversation with Lioncash.

The conversation can be seen here: https://user-images.githubusercontent.com/20753089/45064197-b6107800-b0b2-11e8-9db8-f696299fb86a.PNG
parent 89abef35
No related branches found
No related tags found
No related merge requests found
...@@ -112,12 +112,6 @@ ...@@ -112,12 +112,6 @@
template <std::size_t Position, std::size_t Bits, typename T, typename EndianTag = LETag> template <std::size_t Position, std::size_t Bits, typename T, typename EndianTag = LETag>
struct BitField { struct BitField {
private: private:
// We hide the copy assigment operator here, because the default copy
// assignment would copy the full storage value, rather than just the bits
// relevant to this particular bit field.
// We don't delete it because we want BitField to be trivially copyable.
constexpr BitField& operator=(const BitField&) = default;
// UnderlyingType is T for non-enum types and the underlying type of T if // UnderlyingType is T for non-enum types and the underlying type of T if
// T is an enumeration. Note that T is wrapped within an enable_if in the // T is an enumeration. Note that T is wrapped within an enable_if in the
// former case to workaround compile errors which arise when using // former case to workaround compile errors which arise when using
...@@ -131,6 +125,8 @@ private: ...@@ -131,6 +125,8 @@ private:
using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type; using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type;
public: public:
BitField& operator=(const BitField&) = default;
/// Constants to allow limited introspection of fields if needed /// Constants to allow limited introspection of fields if needed
static constexpr std::size_t position = Position; static constexpr std::size_t position = Position;
static constexpr std::size_t bits = Bits; static constexpr std::size_t bits = Bits;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment