52904.fb2 Integration of the Standard Template Library and the Microsoft Foundation Class - читать онлайн бесплатно полную версию книги . Страница 3

Integration of the Standard Template Library and the Microsoft Foundation Class - читать онлайн бесплатно полную версию книги . Страница 3

3 Conclusion

The STL containers can be easily adapted to be used in Windows® applications in place of the MFC collection classes. By adding the CArchive input and output iterators, the use of the standard algorithms can be applied to the serialization process.

The STL containers are more general than the MFC collection classes. By separating the iterators from the containers themselves, and by providing a common interface for all containers, the STL container choice is independent of the algorithm. The Scribble example uses a linked list of arrays to represent the strokes. This was replicated in the STL version. The STL version could easily be changed to use an array (vector) of lists, or a list of lists, or an array of arrays.

We first developed this example using Microsoft's Visual C++ version 5.0. We experienced numerous difficulties requiring us to define a class, MYCPoint to extend the CPoint class and developing modified versions of the function binders and adapters. Microsoft's Visual C++ version 6.0 does not require these workarounds.