Find-or-insert with only one lookup in c# dictionary

后端 未结 6 1890
粉色の甜心
粉色の甜心 2021-01-17 17:38

I\'m a former C++/STL programmer trying to code a fast marching algorithm using c#/.NET technology...

I\'m searching for an equivalent of STL method \"map::insert\"

6条回答
  •  [愿得一人]
    2021-01-17 18:05

    Is there something that explains why this is not possible using .NET containers ?

    Without knowing the real background, I assume it is because of simplicity of the Dictionary. There are only the basic, easy to understand functions: Add, Remove a.s.o., while the index operator does a little bit of magic, which was probably assumed to be intuitive.

提交回复
热议问题