異なるモジュールの両方のクラスで注釈を使用したいのですが? from BModule import B
class A:
def method(self, b: B):
pass
〜 from AModule import A
class B:
def method(self, a: A):
pass
私はImportError: canno
次のエラーが表示されます。すべてのクラスで 'class name' does not name a typeです。 私はそれが循環依存であるかもしれないと思うが、各クラスが次の関数からのアクセスを必要とするので、どのようにそれを解決するかという手がかりはない。以下は、私のクラスは次のとおりです。 Container.h: #ifndef CONTAINER_H
#define CONTAINE
これはC++言語の限界を知るための質問です。 ほとんどの循環クラスの依存関係は、前方宣言とポインタで解決できます。 しかし、私は、これは何とか解決することができるかどうか疑問:人間の目でそれを解析 struct Y; // forward declaring Y does not solve the problem
struct X {
using T = int;
usi