Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-8603

scoped_allocator_adaptor can't be explicitly instantiated with two arguments

    XMLWordPrintable

Details

    • Bug
    • Status: New
    • Medium
    • Resolution: Unresolved
    • Code Generation Tools
    • CODEGEN-3953
    • 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
    • Hide
      Due to an implementation detail in the library, a specialization of scoped_allocator_adaptor with two template arguments (example below) will cause a compilation error.

      #include <memory>
      #include <scoped_allocator>
      struct A00 : std::allocator<char> {
        A00() {}
        template <class P> A00(const P&) {}
      };

      template <class T> struct A01 {
        typedef T value_type;
        A01() {}
        template <class P> A01(const P&) {}
        T* allocate(std::size_t n);
        void deallocate(T* p, std::size_t n);
      };

      template <class T> std::allocator<T> a02(void) {
        return std::allocator<T>();
      }

      int main()
      {
         std::scoped_allocator_adaptor<A00> a00;
         const std::scoped_allocator_adaptor<A00>& r00 = a00;
         if (!noexcept(std::scoped_allocator_adaptor<A01<int>, A00>(
                          a02<int>(), r00)))
            return 1;
      }
      Show
      Due to an implementation detail in the library, a specialization of scoped_allocator_adaptor with two template arguments (example below) will cause a compilation error. #include <memory> #include <scoped_allocator> struct A00 : std::allocator<char> {   A00() {}   template <class P> A00(const P&) {} }; template <class T> struct A01 {   typedef T value_type;   A01() {}   template <class P> A01(const P&) {}   T* allocate(std::size_t n);   void deallocate(T* p, std::size_t n); }; template <class T> std::allocator<T> a02(void) {   return std::allocator<T>(); } int main() {    std::scoped_allocator_adaptor<A00> a00;    const std::scoped_allocator_adaptor<A00>& r00 = a00;    if (!noexcept(std::scoped_allocator_adaptor<A01<int>, A00>(                     a02<int>(), r00)))       return 1; }

    Description

      scoped_allocator_adaptor can't be explicitly instantiated with two arguments

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: