thinking in c 2nd ed volume 2 rev 20 - phần 10 pptx
... driveTrainBotHired = true; } void insertCar(Car chassis) { c = chassis; occupied = true; } Car getCar() { // Can only extract car once if(!occupied) { cerr << "No Car in Cradle ... James · 693 CountedPtr, reference-counting template in ZThread library (Concurrency) · 743 covariance: exception specifications · 69 Crahen, Eric · 722 creating: manipulators · 23 0 creat...
Ngày tải lên: 13/08/2014, 09:20
... program: Comment constructing Trace #0 constructing Trace #1 constructing Trace #2 constructing Trace #3 destructing Trace #2 destructing Trace #1 destructing Trace #0 caught 3 25 z 516 library ... text. Edited Chapter 3: z Added a wide-character version of ichar_traits z Replaced SiteMapConvert.cpp with ExtractCode.cpp z Added exercises Revision 6 (July 27 , 20 02) Finished Chapt...
Ngày tải lên: 13/08/2014, 09:20
... ne(wchar_t c1 st, wchar_t c2 nd) { return towupper (c1 st) != towupper (c2 nd); } static bool lt(wchar_t c1 st, wchar_t c2 nd) { return towupper (c1 st) < towupper (c2 nd); } static int compare(const ... max; //Track largest number int current; // Current non-contained number // Used in notContained() // Find the next number not contained in the array int notContained() {...
Ngày tải lên: 13/08/2014, 09:20
thinking in c 2nd ed volume 2 rev 20 - phần 3 ppt
... strings for this extractor: Comment "0 8-1 0 -2 0 03" " 8-1 0 -2 0 03" "08 - 10 - 20 03" but these are not: "A -1 0 -2 0 03" // No alpha characters allowed "08 %10 /20 03" ... number counter: const string ERRNUM; // File containing error lines: const string ERRFILE; stringstream edited; // Edited file int count...
Ngày tải lên: 13/08/2014, 09:20
thinking in c 2nd ed volume 2 rev 20 - phần 5 potx
... objects. They are admittedly simple, but you can use them to compose more complicated function objects. Consequently, in many instances, you can construct complicated predicates without writing ... usemin2() { std::cout << min(3.1,4 .2) << std::endl; } ///:~ //: C0 5:MinMain.cpp //{L} UseMin1 UseMin2 MinInstances void usemin1(); void usemin2(); int main() { usemin1();...
Ngày tải lên: 13/08/2014, 09:20
thinking in c 2nd ed volume 2 rev 20 - phần 6 doc
... sorted ranges #include <algorithm> #include <cassert> #include <ctime> #include <cstdlib> #include <cstddef> #include <fstream> #include <iostream> #include ... iterator’s pointer is now pointing off into nowhere: Comment //: C0 7:VectorCoreDump.cpp // Invalidating an iterator #include <iterator> #include <iostream> #include <vector&g...
Ngày tải lên: 13/08/2014, 09:20
thinking in c 2nd ed volume 2 rev 20 - phần 7 pps
... of words used in a document #include <algorithm> #include <cctype> #include <cstring> #include <fstream> #include <iostream> #include <iterator> #include <set> #include ... <iostream> #include <map> #include <ctime> using namespace std; int main(){ hash_map<int, int> hm; map<int, int> m; clock_t ticks = clock(); f...
Ngày tải lên: 13/08/2014, 09:20
thinking in c 2nd ed volume 2 rev 20 - phần 8 pps
... combine the creation of the static object inside a member function with the Singleton class. SingletonPattern.cpp can be modified to use this approach: Comment //: C1 0:SingletonPattern2.cpp // ... successful because B2 is actually pointing to an Mi2 object, which contains a subobject of type B1. Casting to intermediate levels brings up an interesting difference between dynamic_cast and...
Ngày tải lên: 13/08/2014, 09:20
thinking in c 2nd ed volume 2 rev 20 - phần 9 ppsx
... ///:~ Incrementer now contains a CountedPtr object, which manages a Count. In main( ), the CountedPtr objects are passed into the two Incrementer objects by value, so the copy- constructor is called, ... <vector> #include <cstdlib> #include <ctime> using namespace ZThread; using namespace std; class Count : public Cancelable { FastMutex lock; int count; bool paused...
Ngày tải lên: 13/08/2014, 09:20