Boost 将';void*const*';不会编译

Boost 将';void*const*';不会编译,boost,constants,Boost,Constants,以下代码作为一个问题最少的示例编写,无法编译: #include <boost/serialization/strong_typedef.hpp> BOOST_STRONG_TYPEDEF( void * const *, my_const_iterator ) int main() { return 0; } 因此,编译器似乎在说问题在于将void*const*const转换为void*const*,但这段代码编译得很好(忽略了b未使用的警告),因为在我看来它应该: i

以下代码作为一个问题最少的示例编写,无法编译:

#include <boost/serialization/strong_typedef.hpp>

BOOST_STRONG_TYPEDEF( void * const *, my_const_iterator )
int main() {
    return 0;
}
因此,编译器似乎在说问题在于将
void*const*const
转换为
void*const*
,但这段代码编译得很好(忽略了b未使用的警告),因为在我看来它应该:

int main() {
    void * const * const a( nullptr );
    void * const * b( a );
    return 0;
}

我想我一定错过了一些愚蠢的事情。为什么BOOST\u STRONG\u TYPEDEF无法编译?

您的代码注释让我感到困惑。如果您不想要警告,为什么不省略参数或将其强制转换为
void
?两者都比你的古怪代码+注释更简单。@KonradRudolph我按照建议简化了示例,还删除了其中一个typedef,因此它现在确实是一个“最小问题示例”。谢谢。
int main() {
    void * const * const a( nullptr );
    void * const * b( a );
    return 0;
}