Skip to content

Commit

Permalink
Merge pull request #394 from jwillemsen/jwi-stdtounderlying
Browse files Browse the repository at this point in the history
Make use of std::to_underlying when we have C++23
  • Loading branch information
jwillemsen committed Aug 5, 2024
2 parents 1d69715 + 8b7b1f3 commit 9462b66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ridlbe/c++11/templates/cli/src/bitmask_cdr.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// generated from <%= ridl_template_path %>
TAO_CORBA::Boolean operator<< (TAO_OutputCDR &strm, const <%= scoped_cxxname %> &_tao_bitmask)
{
#if defined (ACE_HAS_CPP23)
return strm << std::to_underlying (_tao_bitmask);
#else
return strm << static_cast<<%= bitbound.cxx_type %>> (_tao_bitmask);
#endif
}

TAO_CORBA::Boolean operator>> (TAO_InputCDR &strm, <%= scoped_cxxname %> &_tao_bitmask)
Expand Down
4 changes: 4 additions & 0 deletions ridlbe/c++11/templates/cli/src/enum_cdr.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// generated from <%= ridl_template_path %>
TAO_CORBA::Boolean operator<< (TAO_OutputCDR &strm, const <%= scoped_cxxname %> &_tao_enumerator)
{
#if defined (ACE_HAS_CPP23)
return strm << std::to_underlying (_tao_enumerator);
#else
return strm << static_cast<<%= bitbound.cxx_type %>> (_tao_enumerator);
#endif
}

TAO_CORBA::Boolean operator>> (TAO_InputCDR &strm, <%= scoped_cxxname %> &_tao_enumerator)
Expand Down

0 comments on commit 9462b66

Please sign in to comment.