Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-42313

Fix forwarding reference issue in `ScopeGuard`

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.1
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2, v4.0, v3.6
    • Sprint:
      Dev Tools 2019-07-15, Dev Tools 2019-07-29

      Description

      ```
      template< typename T >

      void
      f( T &&t )

      {   T x= std::move( t ); }

      ```

      This is somewhat incorrect (even though this has a `const T &` overload in `ScopeGuard` – `std::forward< T >` is what should be used.

      We should also consider removing the move operations entirely from `ScopeGuard` in favour of using the pure MCE/NRV/RVO transform.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: