Building an unordered map with tuples as keys

前端 未结 6 999
南方客
南方客 2021-02-01 05:40

In a C++ program with Boost, I am trying to build an unordered map whose keys are tuples of doubles:

typedef boost::tuples::tuple

        
6条回答
  •  梦如初夏
    2021-02-01 06:18

    The Boost documentation gives the required interface. Without knowing more about the values involved, it's hard to say a lot more. Given a key object as input, it has to produce a size_t that's deterministic -- i.e., it's a pure function, where the result depends solely on the input value, so giving the same input will always produce the same hash code.

提交回复
热议问题