I have really heavy task to achieve and I haven’t found any solution good enough. So, here is the description:
– task is to evaluate multiple single dimension arrays which number can vary
– good news is that it is possible to specify types of arrays
And desirable way of doing it:
– creating a class with constructor that accepts variable number of arrays
– these arrays should be also used as properties (private members), so multiple operations can be done on(with) them during lifecycle of object
How I tried to do it:
– constructor member function with variable number of paramaters (I’m not sure why this doesn’t work)
– constructor with vector should be better way, but how to store arrays that type is specified in separate array, meaning you can’t expect certain datatype for certain array in advance
– I tried to declare variable number of arrays as private members with preprocessor, but it seems loops and other code do not work well inside private: declaration
Any idea from anybody?
the inner vectors can be of different sizes but must be of the same type.
You can use a function with variable number of parameters that creates a class, look at how boost::bind works, that takes lots of different parameter lists.
boost mpl may answer what you are trying to do, although it is rather unclear.