priority_queue<> comparison for pointers?

前端 未结 3 840
离开以前
离开以前 2020-12-19 15:32

So I\'m using the STL priority_queue<> with pointers... I don\'t want to use value types because it will be incredibly wasteful to create a bunch of new objects just for

3条回答
  •  悲&欢浪女
    2020-12-19 16:32

    An integer is the same size as a pointer on 32 bit systems. On 64 bit systems, a pointer will be twice as big. Therefore, it is simpler/faster/better to use regular integers.

提交回复
热议问题