Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Keeping smart pointers in a dynamic array.

Keeping smart pointers in a dynamic array.

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VCSharp007
    wrote on last edited by
    #1

    Hi, Please suggest a method to keep an array of smart pointers(IXMLDOMElementPtr) in an dynamic array. Can we use any built-in collection classes for this purpose? Please help by giving the best method. Thanx in advance

    A 1 Reply Last reply
    0
    • V VCSharp007

      Hi, Please suggest a method to keep an array of smart pointers(IXMLDOMElementPtr) in an dynamic array. Can we use any built-in collection classes for this purpose? Please help by giving the best method. Thanx in advance

      A Offline
      A Offline
      act_x
      wrote on last edited by
      #2

      STL vector

      Engineering is the effort !

      S 1 Reply Last reply
      0
      • A act_x

        STL vector

        Engineering is the effort !

        S Offline
        S Offline
        Stephen Hewitt
        wrote on last edited by
        #3

        Actually, in general COM smart pointers can't be used in STL collections without adaption as they overide operator &.

        Steve

        V 1 Reply Last reply
        0
        • S Stephen Hewitt

          Actually, in general COM smart pointers can't be used in STL collections without adaption as they overide operator &.

          Steve

          V Offline
          V Offline
          VCSharp007
          wrote on last edited by
          #4

          So, any other solution? How to adapt STL collections for keeping smart pointers.

          S 1 Reply Last reply
          0
          • V VCSharp007

            So, any other solution? How to adapt STL collections for keeping smart pointers.

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            In ATL you use the CAdapt class. Or you can use smart pointers that don't overload operator &. Another alternative would be to create or use collections that use similar techniques to Boost's addressof[^] template (or use it).

            Steve

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups