Try to use CDynamicArray http://www.shogun-toolbox.org/doc/en/latest/classshogun_1_1CDynamicArray.html
rather than std.