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

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 41', 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ả | intrusive_ptr Header boost intrusive_ptr is the intrusive analogue to shared_ptr. Sometimes there s no other choice than using an intrusive reference-counted smart pointer. The typical scenario is for code that has already been written with an internal reference counter and where there s no time to rewrite it or where the code s not available . Another case is when the size of a smart pointer must be exactly the size of a raw pointer or when performance is hurt by the allocation of the reference count for shared_ptr a rare case I m sure . The only case where it would seem that an intrusive smart pointer is required from a functional perspective is when a member function of a pointed-to class needs to return this such that it can be used in another smart pointer. Actually there are ways to solve that problem with nonintrusive smart pointers too as we saw earlier in this chapter. intrusive_ptr is different from the other smart pointers because it requires you to provide the reference counter that it manipulates. When intrusive_ptr increments or decrements a reference count on a non-null pointer it does so by making unqualified calls to the functions intrusive_ptr_add_ref and intrusive_ptr_release respectively. These functions are responsible for making sure that the reference count is always correct and if the reference counter drops to zero to delete the pointer. Therefore you must overload those functions for your type as we shall see later. This is a partial synopsis for intrusive_ptr showing the most important functions. namespace boost template class T class intrusive_ptr public intrusive_ptr T p bool add_ref true intrusive_ptr const intrusive_ptr r intrusive_ptr T operator const T operator- const T get const operator unspecified-bool-type const template class T T get_pointer const intrusive_ptr T p template class T class U intrusive_ptr T static_pointer_cast const intrusive_ptr U r Members intrusive_ptr T p bool add_ref true This constructor .

TÀI LIỆU LIÊN QUAN
10    127    1
6    150    1
7    127    1
5    125    1
6    127    1
6    115    1
6    122    1
6    174    1
7    122    1
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.