Skip to content

Commit

Permalink
Merge pull request #396 from jwillemsen/jwi-std_underlying_type_t
Browse files Browse the repository at this point in the history
Simplify code generation by using std::underlying_type_t
  • Loading branch information
jwillemsen committed Sep 2, 2024
2 parents 9462b66 + 8c948a4 commit 1e98f67
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/cli/src/bitmask_cdr.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TAO_CORBA::Boolean operator<< (TAO_OutputCDR &strm, const <%= scoped_cxxname %>

TAO_CORBA::Boolean operator>> (TAO_InputCDR &strm, <%= scoped_cxxname %> &_tao_bitmask)
{
<%= bitbound.cxx_member_type %> _tao_temp <%= bitbound.value_initializer %>;
std::underlying_type_t<<%= scoped_cxxname %>> _tao_temp <%= bitbound.value_initializer %>;
bool const _tao_success = strm >> <%= bitbound.cdr_to_fmt % "_tao_temp" %>;

if (_tao_success)
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/cli/src/bitset_cdr.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TAO_CORBA::Boolean operator<< (TAO_OutputCDR &/*strm*/, const <%= scoped_cxxname
TAO_CORBA::Boolean operator>> (TAO_InputCDR &/*strm*/, <%= scoped_cxxname %> & /*_tao_bitset*/)
{
return true;
%# <%= bitbound.cxx_member_type %> _tao_temp <%= bitbound.value_initializer %>;
%# std::underlying_type_t<<%= scoped_cxxname %>> _tao_temp <%= bitbound.value_initializer %>;
%# bool const _tao_success = strm >> <%= bitbound.cdr_to_fmt % "_tao_temp" %>;
%#
%# if (_tao_success)
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/cli/src/enum_cdr.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TAO_CORBA::Boolean operator<< (TAO_OutputCDR &strm, const <%= scoped_cxxname %>

TAO_CORBA::Boolean operator>> (TAO_InputCDR &strm, <%= scoped_cxxname %> &_tao_enumerator)
{
<%= bitbound.cxx_member_type %> _tao_temp <%= bitbound.value_initializer %>;
std::underlying_type_t<<%= scoped_cxxname %>> _tao_temp <%= bitbound.value_initializer %>;
bool const _tao_success = strm >> <%= bitbound.cdr_to_fmt % "_tao_temp" %>;

if (_tao_success)
Expand Down

0 comments on commit 1e98f67

Please sign in to comment.