TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 39

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 39', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | never throws. T operator- const The operator returns the stored pointer. This together with operator is what makes the smart pointer look like an ordinary pointer. This operator never throws. T get const The get function is the preferred way of retrieving the stored pointer when it might be null in which case operator and operator- leads to undefined behavior . Note that it is also possible to test whether a shared_ptr contains a valid pointer by using the implicit Boolean conversion. This function never throws. bool unique const This function returns true if the shared_ptr is the sole owner of the stored pointer otherwise it returns false. unique never throws. long use_count const The use_count function returns the reference count for the pointer. It is especially useful for debugging purposes because it can be used to get snapshots of the reference count at critical points of program execution. Use it sparingly. For some possible implementations of the shared_ptr interface calculating the reference count may be expensive or even impossible. The function never throws. operator unspecified-bool-type const This implicit conversion to a type unspecified-bool-type makes it possible to test a smart pointer in Boolean contexts. The value is TRue if the shared_ptr is currently storing a valid pointer otherwise it is false. Note that the type that this conversion function returns is not specified. Using bool as the return type allows for some nonsensical operations so typically an implementation uses the safe bool idiom 8 which is a nifty way of ensuring that only applicable Boolean tests can be used. The function never throws. 8 Invented by Peter Dimov. void swap shared_ptr T b It is sometimes convenient to swap the contents of two shared_ptrs. The swap function exchanges the stored pointers and their reference counts . This function never throws. Free Functions template typename T typename U shared_ptr T static_pointer_cast const shared_ptr U r To perform a static_cast

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.