Well, I've come to the conclusion that I might be able to go with a vector,
if I can figure a way to iterate through it until I find the element I'm
searching for.
Say, I got a row:
-- name -- -- help -- -- syntax --
"test" "Test command." "<test>"
I do: select * from mytable;
Now, I'd like to search through the result set until I find the vector
element that matches "test". How would I do this?
Hope I explained it well.. Kind of tired right now.
Thanks.
2008/8/17 Warren Young <mysqlpp@stripped>
> On Aug 17, 2008, at 4:09 AM, Alex wrote:
>
> From looking at the example, it seems I have to use classes/structs to
>>> copy
>>>
>> the data into a map. Is this correct? Or, can I just use a simple
>> function,
>> or something?
>>
>
> The construct is called a functor:
>
> http://en.wikipedia.org/wiki/Function_object
>
> Functors have several advantages over function pointers, which is why
> they're used throughout STL. This feature of MySQL++ is modeled on STL
> algorithms like find_if().
>
> It's true, they're rather heavy on the syntactic noise. If C++ supported
> anonymous (lambda) functions, we'd use them instead in places like this, but
> it doesn't, so we use functors.
>
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>
--
GamerzWoW - http://www.gamerzwow.net