I have a couple of struct:
Code:
struct MyData_t
{
int dataA;
int dataB;
}

struct MyHistory_t
{
struct MyData_t data;
long time;
}

then I have a vector:

typedef std::vector<MyHistory_t> HistoryList_t;

HistoryList_t history;
I fill my vector with half a dozen values and then I want to perform a median function on just dataA. But other times I may want to perform a median of both dataA and dataB. I can provide some of the code for the math functions, but I think the problem is found in how I structured my data.

What do you guys think about the code I've shown so far? How can I make it more elegant and easier to do math operations on individual data arrays. One idea is to write a function to return an array of dataA and another for dataB. I'll post more info in a bit.