[BUG]: std::move_constructible and pybind11::detail::is_move_constructible differ

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
devtools

調査の方向性

再現可能な静的アサーションから始め、pybind11/pybind11.h 経由でインクルードされる pybind11::detail::is_move_constructible の定義を追跡してください。例 A と B について、その動作を std::move_constructible と比較し、存在する場合は既存の trait テストを調べてください。動作の違いが標準のコンセプトに沿うように調整されるか、明確に正当化されて回帰テストでカバーされれば完了です。

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

説明

triage
Required prerequisites
What version (or hash if on master) of pybind11 are you using?

3.0.1

Problem description

I'm not sure this is a bug.

Must std::move_constructible concept and pybind11::is_move_constructible evaluate the same?

When a struct has a value_type member typedef set to void the two predicates differ (cf. code below).
I stumbled into this problem using CGAL (cf. https://github.com/CGAL/cgal/issues/9319).

Reproducible example code
#include <concepts>
#include <pybind11/pybind11.h>

struct A {
    typedef int value_type;
};
static_assert(std::move_constructible<A>); // OK
static_assert(pybind11::detail::is_move_constructible<A>::value); // OK

struct B {
    typedef void value_type;
};
static_assert(std::move_constructible<B>); // OK
static_assert(pybind11::detail::is_move_constructible<B>::value); // fails
Is this a regression? Put the last known working version here if it is.

Not a regression

主要言語
C++
スター
18k
フォーク
2.3k
平均マージ
5日 7時間
マージ済み PR(30日)
53

環境構築

はじめの一歩

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

pybind/pybind11 のほかの issue

pybind/pybind11 の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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