shared_ptr::get_deleter() should return the original deleter class without copying

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • Code Generation Tools
    • CODEGEN-4050
    • Hide
      ARM_18.1.0.LTS
      ARM_18.12.0.LTS
      ARM_20.2.0.LTS
      Show
      ARM_18.1.0.LTS ARM_18.12.0.LTS ARM_20.2.0.LTS

      shared_ptr::get_deleter() should return the original deleter class without copying. Test case:

      #include <stdio.h>
      #include <memory>
      struct S {
      int m;
      S(int i) : m {}
      };

      bool flag = false;

      struct Deleter {
      int m;
      Deleter() : m(1) {}
      Deleter(const Deleter& d)

      { m = 2*d.m; }

      void operator() (void* p)

      { flag = true; }

      };

      int main(void)

      { Deleter x00; std::shared_ptr<char> p00(new char, x00); Deleter* pg00 = std::get_deleter<Deleter, char>(p00); if ( pg00 != &x00) printf("Got m=%d instead of m=%d.\n", pg00->m, x00.m); }

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-1094 - shared_ptr::get_deleter() should re...
                SYNCHRONIZED
                • Last Sync Date: