diff --git a/ridlbe/c++11/templates/cli/hdr/bitset.erb b/ridlbe/c++11/templates/cli/hdr/bitset.erb index 89a00047..d5e2117d 100644 --- a/ridlbe/c++11/templates/cli/hdr/bitset.erb +++ b/ridlbe/c++11/templates/cli/hdr/bitset.erb @@ -27,17 +27,8 @@ public: % end %end -%# Add base class support - bool operator== (const <%= cxxname %> &rhs) const { return -%_ms = bitfields.dup.find_all {|bitf| !bitf.cxxname.empty? } -%unless _ms.empty? -% while !_ms.empty? -% _m = _ms.shift - (this->_taox11_<%= cxxname.downcase %>.<%= _m.cxxname %> == rhs._taox11_<%= cxxname.downcase %>.<%= _m.cxxname %>)<%= _ms.empty? ? ';' : '&&' %> -% end -%end - }; - bool operator!= (const <%= cxxname %> &rhs) const { return !this->operator== (rhs);}; + bool operator== (const <%= cxxname %> &rhs) const; + bool operator!= (const <%= cxxname %> &rhs) const; %bitfields.find_all {|bitf| !bitf.cxxname.empty? }.each do |_m| inline void <%= _m.cxxname %> (<%= _m.cxx_in_type %> _x11_<%= _m.cxxname %>) { this->_taox11_<%= cxxname.downcase %>.<%= _m.cxxname %> = _x11_<%= _m.cxxname %>; } diff --git a/ridlbe/c++11/templates/cli/inl/bitset_inl.erb b/ridlbe/c++11/templates/cli/inl/bitset_inl.erb index 1487377d..ce54d48f 100644 --- a/ridlbe/c++11/templates/cli/inl/bitset_inl.erb +++ b/ridlbe/c++11/templates/cli/inl/bitset_inl.erb @@ -35,3 +35,22 @@ inline void <%= scoped_cxxtype %>::swap (<%= scoped_cxx_out_type %> s) std::swap (this->_taox11_<%= cxxname.downcase %>, s._taox11_<%= cxxname.downcase %>); %# end } + +inline bool <%= scoped_cxxtype %>::operator== (const <%= cxxname %> &rhs) const { + return +%unless base.nil? + <%= base.cxxname %>::operator==(rhs) && +%end +%_ms = bitfields.dup.find_all {|bitf| !bitf.cxxname.empty? } +%unless _ms.empty? +% while !_ms.empty? +% _m = _ms.shift + (this->_taox11_<%= cxxname.downcase %>.<%= _m.cxxname %> == rhs._taox11_<%= cxxname.downcase %>.<%= _m.cxxname %>)<%= _ms.empty? ? ';' : ' &&' %> +% end +%end +} + +inline bool <%= scoped_cxxtype %>::operator!= (const <%= cxxname %> &rhs) const +{ + return !this->operator== (rhs); +}