static validation of closed overrider sets

オープン
#137 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
compilers

調査の方向性

Start by reading the BOOST_OPENMETHOD interface and the project’s compile-time dispatch and ambiguity-checking code; the issue provides no file or test names. Determine how a declared set of overriders could be checked for missing or ambiguous virtual tuples while allowing later specializations, then add coverage for those cases. Done means the compile-time guarantee works for the declared set and the documented limitation for later specializations is clear.

索引モデルが issue の本文から書いたものです。

説明

enhancement explore

Inspired by https://github.com/Boumg/mini-openmethod.

Many reasonable applications of open-methods require only semi-openness, i.e. the ability to add polymorphic behavior to existing class hierarchies, without the need to specialize existing methods. In that case, the method could optionally specify a set of overriders, which would be checked at compile time for missing or ambiguous virtual tuples. The mechanism could naturally extend BOOST_OPENMETHOD:

BOOST_OPENMETHOD(
    poke, (virtual_ptr<Animal>, std::ostream& os), void,
    [](virtual_ptr<Cat>, std::ostream& os) {
        os << "hiss";
    },
    [](virtual_ptr<Dog>, std::ostream& os) {
        os << "bark";
    }
);

User would retain the ability to add specializations afterwards, but then the compile time guarantee would be off.

主要言語
C++
スター
14
フォーク
7
平均マージ
3日 3時間
マージ済み PR(30日)
15

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

boostorg/openmethod のほかの issue

boostorg/openmethod の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。