Skip to content

Commit

Permalink
Merge pull request #405 from jwillemsen/jwi-bitmaskdesc
Browse files Browse the repository at this point in the history
Add bitmask destructor
  • Loading branch information
jwillemsen authored Oct 21, 2024
2 parents cfe7abc + d47b842 commit d44f00b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ridlbe/c++11/templates/cli/hdr/bitmask.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ public:
<%= bitvalues.collect {|e| "/// @copydoc #{doc_scoped_name}::#{e.name}\n #{e.cxxname} = 0x01 << #{e.position}" }.join(",\n ") %>
};
<%= cxxname %> () = default;
~<%= cxxname %> () = default;
<%= cxxname %> (<%= cxx_in_type %>) = default;
<%= cxxname %> (<%= cxx_move_type %>) = default;
<%= cxxname %> (<%= bitbound.cxx_in_type %> _v) : _value(_v) {}
<%= cxx_out_type %> operator= (<%= cxx_in_type %>) = default;
<%= cxx_out_type %> operator= (<%= cxx_move_type %>) = default;
operator <%= bitbound.cxx_type %>() const { return _value; }
%# <%= cxx_return_type %> operator~ () { return ~_value; }
%# <%= cxx_return_type %> operator| () { return _value | _taox11_y; }
Expand All @@ -18,10 +23,6 @@ public:
<%= cxx_return_type %>& operator |= (<%= bitbound.cxx_in_type %> _taox11_rhs) { _value |= _taox11_rhs; return *this; }
<%= cxx_return_type %>& operator &= (<%= bitbound.cxx_in_type %> _taox11_rhs) { _value &= _taox11_rhs; return *this; }
<%= cxx_return_type %>& operator ^= (<%= bitbound.cxx_in_type %> _taox11_rhs) { _value ^= _taox11_rhs; return *this; }
<%= cxx_out_type %> operator= (<%= cxx_in_type %>) = default;
<%= cxx_out_type %> operator= (<%= cxx_move_type %>) = default;
<%= cxxname %> (<%= cxx_in_type %>) = default;
<%= cxxname %> (<%= cxx_move_type %>) = default;
private:
<%= bitbound.cxx_member_type %> _value <%= bitbound.value_initializer %>;
}; // <%= cxxname %>
Expand Down

0 comments on commit d44f00b

Please sign in to comment.