CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 280

Threaded View

  1. #11
    Join Date
    Apr 2001
    Location
    San Diego CA
    Posts
    378
    STL is really nifty tool to make a programmer life easier .. but STL code is hard to maintain and debug.
    For example

    class AFX_EXT_CLASS CBulletInfoEntry : public CObject
    {
    DECLARE_SERIAL(CBulletInfoEntry)

    public:
    int nKey; // the Key: (nRow<< 4 | nCol)
    RGBCOLOR nColor;
    int nRow;
    int nCol;
    };

    typedef std::set<CBulletInfoEntry> BULLETMAP;

    BULLETMAP::iterator it = m_Map.find(Key(iRowl, iCol));
    ASSERT(it != m_Map.end()); // the entry should exist

    // At this point i want to view the values of 'it' which is basically a item of BULLETMAP and namely CBulletInfoEntry. But I cannot do this in the debug or watch window. This is one debugging difficulty we face when using STL.
    i.e it->nCol ?
    it->nRow ?

    Also I cannot do this in debug window it,10 ( to see all the 10 items)

    STL is very good at getting the job done quickly. But if there needs to be modification to existing design or if there is a bug then STL is more harder to debug and maintain vs MFC.
    Last edited by voidspace; November 25th, 2003 at 04:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured