Translating python dictionary to C++

前端 未结 7 1028
-上瘾入骨i
-上瘾入骨i 2020-11-30 00:57

I have python code that contains the following code.

d = {}

d[(0,0)] = 0
d[(1,2)] = 1
d[(2,1)] = 2
d[(2,3)] = 3
d[(3,2)] = 4

for (i,j) in d:
    print d[(         


        
7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 01:22

    Have a look at Boost.python. It's for interaction between python and C++ (basically building python libs using C++, but also for embedding python in C++ programs). Most pythons data structures and their C++ equivalents are described (didn't checked for the one you want).

提交回复
热议问题