How Do I define a Double Brackets/Double Iterator Operator, Similar to Vector of Vectors'?

后端 未结 5 855
温柔的废话
温柔的废话 2020-12-08 17:29

I\'m porting code that uses a very large array of floats, which may trigger malloc failures from c to c++. I asked a question about whether I should use vectors or deques a

5条回答
  •  无人及你
    2020-12-08 18:21

    I covered overloading operator[] for a multi-dimensional array in an answer to a previous question.

    I'd probably deal with iterators pretty similarly: Have one iterator that represents a "slice" (row or column) of the multi-dimensional array, and then another that represents an element in that slice.

提交回复
热议问题