2

を使用するアプリケーションをコンパイルしていますsigc++。次のエラーで失敗します。

In file included from /opt/local/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:7:
/opt/local/include/sigc++-2.0/sigc++/functors/functor_trait.h:17:1: error: declaration of anonymous struct must be a definition
struct nil;

問題のコードは次のとおりです。

              namespace sigc {

              /** nil struct type.
               * The nil struct type is used as default template argument in the
               * unnumbered sigc::signal and sigc::slot templates.
               *
               * @ingroup signal
               * @ingroup slot
               */
              #ifndef DOXYGEN_SHOULD_SKIP_THIS
error here -> struct nil;
              #else
              struct nil {};
              #endif

私が理解できないのは、コンパイラがそれを無名構造体と見なす理由です。問題の行は単なる前方宣言ではありませんか?

4

0 に答える 0