Results 1 to 2 of 2

Thread: Evaluate an expression over an STL container

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    1

    Evaluate an expression over an STL container

    I would like to use the evaluate tool to iterate through one of my stl
    containers. The documentation for the evaluate tool only shows simple examples
    where arrays and simple integer iterators are used.

    Is it possible to iterate through an stl container? Is it even possible to declare an STL iterator type variable in the evaluate expression box?

    For example, let's say I have the following program code:

    class MyClass {
    public:
    bool m_flag;
    };

    std::deque <MyClass> g_mySet;

    Now, I'd like to evaluate a little expression snippet that iterates
    through mySet.
    --------------------------
    int numberSet;
    std::deque <MyClass>::iterator myiter;

    numberSet = 0;
    for (myiter = g_mySet.begin (); myiter != g_mySet.end (); myiter++)
    {
    if ((*myiter).m_flag)
    numberSet++;
    }
    numberSet++;


    I get errors when I try to do this, but I may not be using the correct magic
    syntax needed for the Evaluate Expression window. Is this possible?

  2. #2

    Re: [bleair] Evaluate an expression over an STL container

    At this point we don't have support for deque or iterators in the STL transformations. We are looking at improving this support, but are not able to make any guarantees. Of course, if you search our documentation, you will find that we have pointers on how to write your own type transforms, and it has always been our hope that users would chip in useful transforms they have come up with. Hint, hint...
    Pete Thompson
    TotalView Customer Services

Posting Permissions

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