DDS-PSM-Cxx 1.1 RTF Avatar
  1. OMG Issue

DDSPSMC11_ — dds::core::status::StatusMask should allow you to set mutiple Status bits by using the logical OR operation

  • Key: DDSPSMC11_-96
  • Status: open  
  • Source: ZettaScale Technology ( Mr. Erik Hendriks)
  • Summary:

    The current dds::core::status::StatusMask inherits from a bitset, but it does not allow you to use the logical OR ( operator | () ) to set multiple bits in the mask.

    Even though StatusMask inherits from std::bitset (which does allow you to use the | operator() ), any attempt to use it on the StatusMask (as in
    StatusMask | StatusMask) results in a compilation error because the resulting type is a bitset, not a StatusMask.

    This seems a bit weird, since using the logical OR seems the natural way in which people set bits in a mask, and it is a common pattern that is used extensively in its parent, the bitset.

    The current StatusMask does allow you to use the streaming operator << for the same purpose instead, but this does not feel like a natural way of doing it.

    Last but not least, some implementations are already supporting the | operator where others don't, so we might as well want to standardize is to keep application code portable across vendors.

  • Reported: DDS-PSM-Cxx 1.0 — Mon, 20 Dec 2021 21:02 GMT
  • Updated: Mon, 20 Dec 2021 21:02 GMT