hash_combine, hash_range, and hash_value can be constexpr
まだ誰も着手していません。
評価
調査の方向性
include/boost/container_hash/hash.hpp から始めて、hash_combine、hash_range、hash_value、それらのバリエーション、および BOOST_FUNCTIONAL_HASH_ROTL32 パスを調べてください。issue に記載されている C++14–17 と C++20+ の制約を比較してください。完了とは、既存の標準バージョンのパスを壊すことなく、該当する関数が constexpr をサポートすることです。
索引モデルが issue の本文から書いたものです。
説明
https://github.com/boostorg/container_hash/blob/develop/include/boost/container_hash/hash.hpp
Since most part of internal calculations are based on integer arithmetic and bitwise operations, I believe those three functions and all their variants can be marked constexpr today. Can someone please enlighten me, why the standard std::hash<T>::operator() and proposed std::hash_combine() in P0814R2 is not constexpr? (backward-compatibility, or other reasons?)
If we are to provide constexpr-ness, there are two cases of implementations:
- When user is using standard later or equal to C++20
- In this case, non-constexpr intrinsic like
_rotl(defined forBOOST_FUNCTIONAL_HASH_ROTL32) can be replaced withstd::rotl
- In this case, non-constexpr intrinsic like
- When user is using C++14 to C++17 and one prefers constexpr
- The library can fallback to bitwise implementation (which is always
constexpr) - Currently Boost.ContainerHash provides no option for this case. I think new macro like
BOOST_FUNCTIONAL_HASH_USE_CONSTEXPRis needed.
- The library can fallback to bitwise implementation (which is always
refs: cplusplus/papers#253
- 主要言語
- C++
- スター
- 40
- フォーク
- 61
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/container_hash のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
boostorg/container_hash#35 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
boostorg/container_hash#33 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
boostorg/container_hash#31 · コメント 6 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
boostorg/container_hash#4 · コメント 1 件 ·
boostorg/container_hash の issue をすべて見る
似ている issue
-
Web3 RPC: one-element batch request returns an object instead of an array (breaks ethers.js v6)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
FISCO-BCOS/FISCO-BCOS#5706 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
521xueweihan/HelloGitHub#4011 ·
-
docs(simulation): Quickstart publishes UDP 14550, which the SITL images' own docs say not to doオープンstatus:needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
PX4/PX4-Autopilot#29292 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
I/O internal correctness medium priority rt_lib
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
GUI
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
sonic-pi-net/sonic-pi#3594 ·