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

Fix forwarding reference issue in `ScopeGuard`

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v4.2, v4.0, v3.6
    • Dev Tools 2019-07-15, Dev Tools 2019-07-29

      ```
      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.

            Assignee:
            adam.martin@mongodb.com ADAM Martin (Inactive)
            Reporter:
            adam.martin@mongodb.com ADAM Martin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: