Re: shared_ptr::operator-> does not fail for nullptr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 June 2014 16:16, Christoph Mathys wrote:
> Now, is this the expected behaviour of shared_ptr? Do I need to check
> myself that my smart_ptr is non-nil similar to "manual" bounds
> checking when using operator[] on std::vector?

Yes, but a much better analogy than std::vector is using a normal
pointer. Don't dereference it unless you know it's non-null.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux