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 ?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Language Bindings
3 Posts 2 Posters 607 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 8 Jun 2021, 09:25 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 :)

    J 1 Reply Last reply 8 Jun 2021, 10:40
    0
    • D dziko147
      8 Jun 2021, 09:25

      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 :)

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 8 Jun 2021, 10:40 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 8 Jun 2021, 10:43 last edited by
        #3

        thank you for your reply
        Ok i will try this

        1 Reply Last reply
        0

        1/3

        8 Jun 2021, 09:25

        • Login

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