cryptonomex / graphene

MIT License
1.05k stars 336 forks source link

Add compile-time sanity check to generic_index #660

Closed nathanielhourt closed 8 years ago

nathanielhourt commented 8 years ago

generic_index::find fails at runtime if the boost multi_index_container's first index is not an index of object_id_type, and the cause of this failure is nonobvious from the error message. This compile-time check will fail if any generic_index is created around a multi_index_container whose first index is not an index on object_id_type, with a helpful error message explaining the problem, so no one else will ever have to debug this issue. :)