不能编译升压/ any_iterator.hpp在升压1.57 [英] Can't compile boost/any_iterator.hpp in boost 1.57

查看:171
本文介绍了不能编译升压/ any_iterator.hpp在升压1.57的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在(试图)升级VS2012项目使用boost 1.57,我不能再编译 - 很多很多的现身升压/ any_iterator.hpp的(见下文)。作为测试,我创建了一个包含只是一个空的主要功能和的#include助推/ any_iterator.hpp并得到了相同的错误集合的一个新项目。这里是code它在抱怨:

After (attempting to) upgrade a VS2012 project to use boost 1.57, I can no longer compile--lots and lots of error messages coming out of boost/any_iterator.hpp (see below). As a test, I created a new project that contained nothing but an empty main function and #include "boost/any_iterator.hpp" and got the same set of errors. Here is the code it's complaining about:

// snippet from boost/any_iterator.hpp

template<
            class Value
          , class Traversal
          , class Reference
          , class Difference
          , class Buffer
        >
        class postfix_increment_proxy<
                    range_detail::any_iterator< // line 131
                        Value
                      , Traversal
                      , Reference
                      , Difference
                      , Buffer
                    >
                >
        {
            // ...
        };

有是在遵循相同的模式,并产生相同的错误相同的文件的另一个类。 range_detail :: any_iterator 向前声明的一个小文件中上涨:

There is another class in the same file that follows the same pattern and generates identical errors. range_detail::any_iterator is forward-declared a little higher up in the file:

namespace range_detail
{
   // ...
   template<
                class Value
              , class Traversal
              , class Reference
              , class Difference
              , class Buffer = any_iterator_default_buffer
            >
            class any_iterator;
    // ...
}

有关它的价值,这里的一套错误的,我从VS2012得到:

For what it's worth, here's the set of errors I get from VS2012:

Error   1   error C2143: syntax error : missing ';' before '<'  [path]\boost\range\detail\any_iterator.hpp  131
Error   2   error C2059: syntax error : '<' [path]\boost\range\detail\any_iterator.hpp  131
Error   3   error C2065: 'Value' : undeclared identifier    [path]\boost\range\detail\any_iterator.hpp  134
Error   4   error C2065: 'Traversal' : undeclared identifier    [path]\boost\range\detail\any_iterator.hpp  135
Error   5   error C2065: 'Reference' : undeclared identifier    [path]\boost\range\detail\any_iterator.hpp  136
Error   6   error C2065: 'Difference' : undeclared identifier   [path]\boost\range\detail\any_iterator.hpp  137
Error   7   error C2065: 'Buffer' : undeclared identifier   [path]\boost\range\detail\any_iterator.hpp  138
Error   8   error C2923: 'boost::range_detail::any_iterator' : 'Value' is not a valid template type argument for parameter 'Value'  [path]\boost\range\detail\any_iterator.hpp  138
Error   9   error C2923: 'boost::range_detail::any_iterator' : 'Traversal' is not a valid template type argument for parameter 'Traversal'  [path]\boost\range\detail\any_iterator.hpp  138
Error   10  error C2923: 'boost::range_detail::any_iterator' : 'Reference' is not a valid template type argument for parameter 'Reference'  [path]\boost\range\detail\any_iterator.hpp  138
Error   11  error C2923: 'boost::range_detail::any_iterator' : 'Difference' is not a valid template type argument for parameter 'Difference'    [path]\boost\range\detail\any_iterator.hpp  138
Error   12  error C2923: 'boost::range_detail::any_iterator' : 'Buffer' is not a valid template type argument for parameter 'Buffer'    [path]\boost\range\detail\any_iterator.hpp  138
Error   13  error C2143: syntax error : missing ';' before '{'  [path]\boost\range\detail\any_iterator.hpp  140
Error   14  error C2447: '{' : missing function header (old-style formal list?) [path]\boost\range\detail\any_iterator.hpp  140

任何人是否知道一种解决方法吗?

Is anyone aware of a workaround?

推荐答案

这似乎是在升压codeBase的一个bug。 postfix_increment_proxy writable_postfix_increment_proxy 均在的boost ::迭代器::细节命名空间(iterator_facade.hpp)。但是,这两个名称用于在any_iterator.hpp不合格。在这两个名称前面加入的boost ::迭代器::详细:: 允许code编译。

This appears to be a bug in the boost codebase. postfix_increment_proxy and writable_postfix_increment_proxy are both in the boost::iterators::detail namespace (iterator_facade.hpp). However, both names are used unqualified in any_iterator.hpp. Adding boost::iterators::detail:: in front of both names allows the code to compile.

对于任何人谁与编辑提振code的想法,包括iterator_facade.hpp其次是使用空间boost ::迭代器::细节后跟不舒服的包括对于any_iterator.hpp还将在名称空间污染的成本解决问题。 VS2012不支持他们,所以它并没有我好,但你可以presumably使用过多使用C ++ 11。

For anyone who's uncomfortable with the idea of editing boost code, including iterator_facade.hpp followed by using namespace boost::iterators::detail followed by an include for any_iterator.hpp will also solve the problem at the cost of namespace pollution. VS2012 doesn't support them so it doesn't do me any good, but you could presumably use a C++11 using too.

票务提交:
<一href=\"https://svn.boost.org/trac/boost/ticket/10754\">https://svn.boost.org/trac/boost/ticket/10754

这篇关于不能编译升压/ any_iterator.hpp在升压1.57的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆