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

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 94', 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ả | function f_ in a Boolean context. If the function doesn t contain a target a function or function object this yields false which means that we cannot invoke it. This is tested in the implementation of execute. Here s a sample program that uses our new class int main tape_recorder tr command play boost bind tape_recorder play tr command stop boost bind tape_recorder stop tr command forward boost bind tape_recorder stop tr command rewind boost bind tape_recorder rewind tr command record Invoked from some GUI control. if Invoked from some scripting client. Some inspired songwriter has passed some lyrics std string s What a beautiful morning. record. set_function boost bind tape_recorder record tr s To create the concrete commands we use to create function objects that when invoked through the function call operator calls the correct member function of tape_recorder. These function objects are self-contained they are nullary function objects meaning that they can be directly invoked without passing any arguments which is what a boost function void expects. In other words the following code snippet creates a function object that invokes the member function play on the instance of tape_recorder that it is configured with. boost bind tape_recorder play tr Normally we wouldn t be able to store the returned function object from the call to bind but because is compatible with any function object this is possible. boost function void f boost bind tape_recorder play tr Notice that the class also supports calling record which takes an argument of type const std string because of the member function set_function. Because the function object must be nullary we need to bind the context so that record still gets its argument. That of course is a job for binders. Thus before calling record we create a function object that contains the string to be recorded. std string s-What a beautiful morning. record.

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.