Consider how `explicit` should work with protocol conformance for conversion functions

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

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

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

評価

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

調査の方向性

Start by reading issue #421 and the linked review discussion, then compare the conversion behavior shown for protocol and protocol_view. The issue is ready when the intended treatment of explicit conversion functions is agreed and the resulting behavior is addressed.

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

説明

design

From review of #421, @philipcraig raised this concern:

struct I {
  explicit operator bool();
  operator bool() const;
};
struct C { /* the same two members */ };

C c;
bool a = c;              // OK: the const overload
protocol<I> p(C{});
bool b = p;              // OK
protocol_view<I> pv(c);
bool d = pv;             // error: explicit conversion function was not considered

https://github.com/jbcoe/cc-protocol/pull/421#discussion_r4044611392

主要言語
C++
スター
12
フォーク
4
平均マージ
1日 11時間
マージ済み PR(30日)
15

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

jbcoe/cc-protocol のほかの issue

jbcoe/cc-protocol の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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