I have a smart pointer to an object that I need to pass to a method that accepts only a pointer to a pointer.
Here is an example where the original smart pointer loses ownership.
int main(int argc, char* argv[])
{
std::unique_pointer<pcap_if_t> object;
auto object_pointer = object.get();
pcap_findalldevs(&object_pointer, ...);
}
How to do this if the original smart pointer has not lost the right to the pointer?
EDIT:
The function I'm calling is pcap_findalldevs in libpcap. I am afraid that this feature may cause loss of property.
I updated my sample code to reflect what I'm actually doing.
source
share