Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Can i use the same std::unique_ptr smart pointer in multiple Classes ?

Can i use the same std::unique_ptr smart pointer in multiple Classes ?

Scheduled Pinned Locked Moved Unsolved Language Bindings
3 Posts 2 Posters 549 Views
  • 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.
  • D Offline
    D Offline
    dziko147
    wrote on last edited by
    #1

    Hello ,
    Can i use the same std::unique_ptr in different classes ?
    if that is the case how can i call this pointer ?
    thank you :)

    jsulmJ 1 Reply Last reply
    0
    • D dziko147

      Hello ,
      Can i use the same std::unique_ptr in different classes ?
      if that is the case how can i call this pointer ?
      thank you :)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @dziko147 If you want to share a pointer then use std::shared_ptr and not std::unique_ptr...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • D Offline
        D Offline
        dziko147
        wrote on last edited by
        #3

        thank you for your reply
        Ok i will try this

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved