<bdo id='2DXww'></bdo><ul id='2DXww'></ul>

<i id='2DXww'><tr id='2DXww'><dt id='2DXww'><q id='2DXww'><span id='2DXww'><b id='2DXww'><form id='2DXww'><ins id='2DXww'></ins><ul id='2DXww'></ul><sub id='2DXww'></sub></form><legend id='2DXww'></legend><bdo id='2DXww'><pre id='2DXww'><center id='2DXww'></center></pre></bdo></b><th id='2DXww'></th></span></q></dt></tr></i><div id='2DXww'><tfoot id='2DXww'></tfoot><dl id='2DXww'><fieldset id='2DXww'></fieldset></dl></div>
<tfoot id='2DXww'></tfoot>

    1. <small id='2DXww'></small><noframes id='2DXww'>

    2. <legend id='2DXww'><style id='2DXww'><dir id='2DXww'><q id='2DXww'></q></dir></style></legend>

        无法在 boost 1.57 中编译 boost/any_iterator.hpp

        时间:2023-07-18

        <small id='EH7FT'></small><noframes id='EH7FT'>

        <tfoot id='EH7FT'></tfoot>
            <tbody id='EH7FT'></tbody>

          1. <i id='EH7FT'><tr id='EH7FT'><dt id='EH7FT'><q id='EH7FT'><span id='EH7FT'><b id='EH7FT'><form id='EH7FT'><ins id='EH7FT'></ins><ul id='EH7FT'></ul><sub id='EH7FT'></sub></form><legend id='EH7FT'></legend><bdo id='EH7FT'><pre id='EH7FT'><center id='EH7FT'></center></pre></bdo></b><th id='EH7FT'></th></span></q></dt></tr></i><div id='EH7FT'><tfoot id='EH7FT'></tfoot><dl id='EH7FT'><fieldset id='EH7FT'></fieldset></dl></div>
                <bdo id='EH7FT'></bdo><ul id='EH7FT'></ul>
                <legend id='EH7FT'><style id='EH7FT'><dir id='EH7FT'><q id='EH7FT'></q></dir></style></legend>

                  本文介绍了无法在 boost 1.57 中编译 boost/any_iterator.hpp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在(尝试)升级 VS2012 项目以使用 boost 1.57 之后,我无法再编译——来自 boost/any_iterator.hpp(见下文)的大量错误消息.作为测试,我创建了一个新项目,它只包含一个空的 main 函数和 #include "boost/any_iterator.hpp" 并得到了相同的错误集.这是它抱怨的代码:

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

                  有人知道解决方法吗?

                  推荐答案

                  这似乎是 boost 代码库中的一个错误.postfix_increment_proxywritable_postfix_increment_proxy 都在 boost::iterators::detail 命名空间 (iterator_facade.hpp) 中.但是,这两个名称在 any_iterator.hpp 中都未限定使用.在两个名称前添加 boost::iterators::detail:: 允许代码编译.

                  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.

                  对于那些对编辑 boost 代码的想法感到不舒服的人,包括 iterator_facade.hpp 后跟 using namespace boost::iterators::detail 后跟 any_iterator.hpp 的包含也可以解决问题以命名空间污染为代价.VS2012 不支持它们,所以它对我没有任何好处,但你大概也可以使用 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.

                  提交的工单:https://svn.boost.org/trac/boost/ticket/10754

                  这篇关于无法在 boost 1.57 中编译 boost/any_iterator.hpp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:发布模式下的 Regex Boost 库链接警告“重复部分的大小不同"使用 mingw-w64 工具链时 下一篇:在编译时检查类构造函数签名

                  相关文章

                  1. <i id='NAh5p'><tr id='NAh5p'><dt id='NAh5p'><q id='NAh5p'><span id='NAh5p'><b id='NAh5p'><form id='NAh5p'><ins id='NAh5p'></ins><ul id='NAh5p'></ul><sub id='NAh5p'></sub></form><legend id='NAh5p'></legend><bdo id='NAh5p'><pre id='NAh5p'><center id='NAh5p'></center></pre></bdo></b><th id='NAh5p'></th></span></q></dt></tr></i><div id='NAh5p'><tfoot id='NAh5p'></tfoot><dl id='NAh5p'><fieldset id='NAh5p'></fieldset></dl></div>
                  2. <small id='NAh5p'></small><noframes id='NAh5p'>

                    <legend id='NAh5p'><style id='NAh5p'><dir id='NAh5p'><q id='NAh5p'></q></dir></style></legend>

                      • <bdo id='NAh5p'></bdo><ul id='NAh5p'></ul>

                    1. <tfoot id='NAh5p'></tfoot>