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

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 73', 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ả | boost tuple unsigned int std string base tup5 tup5 tup4 2 - test boost tuple int std string derived tup6 12 Example d boost tuple unsigned int std string base tup7 tup6 2 - test In both cases derived test is called which is exactly what we want. tup6 and tup7 are not assignable because you can t assign to a reference which is why tup7 is copy constructed from tup6 and tup6 is initialized with d. Because tup4 and tup5 use pointers for their third element they do support assignment. Note that typically smart pointers are best in tuples as opposed to raw pointers because they alleviate the need to manage the lifetime of the resources to which the pointers refer. However as tup4 and tup5 show pointers don t always refer to something requiring memory management in the tuples. Refer to Library 1 Smart ptr 1 for the details on the powerful smart pointers in Boost. Comparing Tuples To compare tuples you must include boost tuple tuple_comparison. hpp . The relational tuple operators are and and they invoke the same operator for each element pair in order in the tuples being compared. These pair-wise comparisons short circuit meaning that they only compare as many pairs as needed to arrive at the correct result. Only tuples with the same number of elements can be compared and as should be obvious the corresponding element types in the two tuples must be comparable. The test for equality returns TRue if all of the element pairs of the two tuples are also equal. If any one equality comparison between element pairs returns false so does operator . The inequality test is analogous but returns the inverse result. The rest of the relational operators perform lexicographical comparisons. Here s a sample program showing the comparison operators in action. include iostream include string include boost tuple include boost tuple int main boost tuple int std string tup1 11 Match boost tuple short std string tup2 12 Match std cout std .

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.