Core C++ A Software Engineering Approach phần 6

sau đó nó là thành viên triển khai chức năng có thay đổi, không phải là mã khách hàng. Điều này là rất quan trọng để bảo trì. Các thiết lập chức năng phảicả hai chức năng thực hiện các hoạt động tương tự. Các đối tượng hoạt động hơi khác nhau, | file Administrator General 20English 20Learning it2002-7-6 application. Simpo PDF Merge and Split Unregistered Version - http However the use of overloaded operators is not uncommon. They are especially popular in C libraries including the Standard Template Library STL and you have to understand what they do and how they are implemented. The comparison that I make between member functions and friend functions is very important. All too often we make design decisions on the basis of hearsay or arbitrary biases rather than from the point of view of goals of object-oriented programming. Make sure that you do not treat friend functions as X-rated material. Use them if they provide more flexibility for better implementation. But do not overuse them. Chapter 11. Constructors and Destructors Potential Trouble Topics in this Chapter Tn More on Passing Objects by Value Tn Operator Overloading for Nonnumeric Classes Tn More on the Copy Construction Tn Overloading the Assignment Operator Tn Practical Considerations What to Implement Tn Summary Overloaded operator functions give a new twist to object-oriented programming. Instead of concentrating on binding together data and operations and related ideas we find ourselves busy with aesthetic considerations and the issues of equally treating built-in types and programmer-defined types by a C program. This chapter is a direct continuation of the previous chapter. In Chapter 10 Operator Functions Another Good Idea I discussed the issues that are related to the design of numeric classes such as classes Complex and Rational. Objects of these classes are object instances in their own right. All of the issues related to dealing with objects apply to them class declaration control of access to class members design of member functions object definition object initialization and messages file Administrator General 20English 20Leaming it2002-7-6 601 of 1187 8 17 2002 2 57 58 PM file Administrator General

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.