Introducing `variable_t` and similar types for convenience
まだ誰も着手していません。
評価
調査の方向性
まず、既存の boost::histogram::axis::variable の定義と関連するテストを見つけます。この issue ではソースファイルやテストのエントリーポイントは指定されていません。提示された C++ の例で要求されている variable_t の動作を比較し、説明どおりに同等のオプション型を代入して検査できれば、作業完了とみなします。
索引モデルが issue の本文から書いたものです。
説明
@HDembinski Here are some examples why using `variable_t` can bring convenience.
std::is_same_v<
boost::histogram::axis::variable<double, std::string, boost::use_default>,
boost::histogram::axis::variable<double, std::string, decltype(boost::histogram::axis::option::underflow | boost::histogram::axis::option::overflow)>
>
is false,
std::is_same_v<
boost::histogram::axis::variable_t<double, std::string, boost::use_default>,
boost::histogram::axis::variable_t<double, std::string, decltype(boost::histogram::axis::option::underflow | boost::histogram::axis::option::overflow)>
>
is true;
This causes a compile error:
boost::histogram::axis::variable<double, std::string, boost::use_default> a;
boost::histogram::axis::variable<double, std::string, decltype(boost::histogram::axis::option::underflow | boost::histogram::axis::option::overflow)> b;
a = b;
This does not cause a compile error:
boost::histogram::axis::variable_t<double, std::string, boost::use_default> a;
boost::histogram::axis::variable_t<double, std::string, decltype(boost::histogram::axis::option::underflow | boost::histogram::axis::option::overflow)> b;
a = b;
In templates, you can get the meta type, options type, allocator type conveniently if template users write variable_t, not if template users write variable:
template<typename V, typename M, typename O, typename A>
void f(boost::histogram::axis::variable<V, M, O, A>)
{
std::cout << typeid(V).name() << '\n';
std::cout << typeid(M).name() << '\n';
std::cout << typeid(O).name() << '\n';
std::cout << typeid(A).name() << '\n';
}
int main(int argc, char *argv[])
{
f(boost::histogram::axis::variable<>());
//double
//struct boost::use_default
//struct boost::use_default
//class std::allocator<double>
f(boost::histogram::axis::variable_t<>());
//double
//class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
//struct boost::histogram::axis::option::bitset<3>
//class std::allocator<double>
}
In debugger, you can not see what options a has but can see what options b has:

boost::histogram::axis::variable<> a;
boost::histogram::axis::variable_t<> b;
Originally posted by @jhcarl0814 in https://github.com/boostorg/histogram/issues/372#issuecomment-1364494250
- 主要言語
- C++
- スター
- 334
- フォーク
- 75
- 平均マージ
- 18時間 2分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/histogram のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
-
Mixed scalar/array `fill` zeroes the whole histogram when a non-inclusive axis drops the first entry再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
axes should provide strong exception guarantee for metadata対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
boostorg/histogram の issue をすべて見る
似ている issue
-
backlog documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
EchoTools/nevr-runtime#1328 ·
メンテナーはふだん 1 日以内に返信
-
Component - Build
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
HarbourMasters/Lighthouse#655 ·
メンテナーはふだん 1 日以内に返信
-
bug-unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
wazuh/wazuh#40870 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信