Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DocDB] Reduce boilerplate for defining hash functions for structs #25403

Open
1 task done
es1024 opened this issue Dec 21, 2024 · 0 comments
Open
1 task done

[DocDB] Reduce boilerplate for defining hash functions for structs #25403

es1024 opened this issue Dec 21, 2024 · 0 comments
Assignees
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@es1024
Copy link
Contributor

es1024 commented Dec 21, 2024

Jira Link: DB-14634

Description

Defining hash functions for structs requires a lot of boilerplate. For example, to make
boost::hash work with YsqlFullTableName, we have:

inline size_t hash_value(const YsqlFullTableName& table) {
  size_t value = 0;
  boost::hash_combine(value, table.namespace_name);
  boost::hash_combine(value, table.schema_name);
  boost::hash_combine(value, table.table_name);
  return value;
}

This can be reduced with macros similar to YB_STRUCT_TO_STRING.

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@es1024 es1024 added area/docdb YugabyteDB core features status/awaiting-triage Issue awaiting triage labels Dec 21, 2024
@es1024 es1024 self-assigned this Dec 21, 2024
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue and removed status/awaiting-triage Issue awaiting triage labels Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants