On Saturday, 26 March 2016 at 09:47:10 UTC, Ali Çehreli wrote:
Please ignore my earlier response. :)

On 03/25/2016 02:54 PM, data pulverizer wrote:

> template ColumnTable(T...){
[...]
>          auto output = ColumnTable!(new_data)(new_data); //
This is the
> problem

You want to slice the template arguments there. The following removes the infinite recursion:

auto output = ColumnTable!(T[columnRange.begin .. columnRange.end])(new_data);

Ali

Thanks a lot! The subTable() method includes a loop to subset the rows which I forgot to include originally ...

auto subTable(Range rowRange, Range columnRange)(){
                auto new_data = data[columnRange.begin .. columnRange.end];
                foreach(i, col; new_data){
                        new_data[i] = col[rowRange.begin .. rowRange.end];
                }
auto output = ColumnTable!(T[columnRange.begin .. columnRange.end])(new_data); string[] new_names = names[columnRange.begin .. columnRange.end];
                output.setNames(new_names);
                return output;
        }

Reply via email to