首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FlexeLint和boost::bimap

FlexeLint和boost::bimap
EN

Stack Overflow用户
提问于 2012-11-14 22:43:09
回答 1查看 269关注 0票数 0

我在使用boost::bimap的代码片段时遇到了问题。我有一个简单的bimap.cpp,如下所示:

代码语言:javascript
复制
#include <boost/bimap.hpp>

typedef boost::bimap<int, double> TestBimap;

int main()
{
    TestBimap flintTest;
    return 0;
}

我知道这不是一个完美的例子,但它只是一个例子。我在上面运行了flint:

代码语言:javascript
复制
flint --i../flexelint_cfg/ --i/home/rat/boost/1.45.0/include ../flexelint_cfg//co-gcc.lnt  bimap.cpp

和flint返回了大量的错误。从上到下的几个例子是:

代码语言:javascript
复制
    --- Module:   bimap.cpp (C++)$
    $
      While instantiating boost::bimaps::bimap<int,double> at File bimap.cpp line 7$
      While instantiating boost::bimaps::detail::bimap_core<int,double,mpl_::na,mpl_::na,mpl_::na>$
        at File /boost/1.45.0/include/boost/bimap/bimap.hpp$
        line 137$
      While instantiating struct boost::bimaps::detail::manage_bimap_key<int> at$
        File /boost/1.45.0/include/boost/bimap/detail/bimap_core.hpp$
        line 90$
      While instantiating struct boost::bimaps::set_of<int> at File$
        /boost/1.45.0/include/boost/bimap/detail/manage_bimap_key.hpp$
        line 69$
      While instantiating struct boost::concepts::requirement_<void$
        (*)(boost::AssignableConcept<int>)> at File /boost/1.45.0/include/boost/bimap/set_of.hpp$
        line 130$
      While instantiating struct boost::AssignableConcept<int> at File$
        /boost/1.45.0/include/boost/concept/detail/general.hpp$
        line 54$
      While instantiating struct boost::Assignable<int> at File$
        /boost/1.45.0/include/boost/concept_check.hpp$
        line 137$
      While instantiating struct boost::concepts::requirement_<void$
        (*)(boost::concepts::usage_requirements<boost::Assignable<int>>)> at File$
        /boost/1.45.0/include/boost/concept_check.hpp$
        line 139$
      While instantiating struct boost::mpl::if_<boost::concepts::not_satisfied<boost::concepts::usage_requirements<boost::Assignable<int>$
    >>,boost::concepts::constraint<boost::concepts::usage_requirements<boost::Assignable<int>>>,boost::concepts::requirement<boost::concepts::f$
    ailed ************usage_requirements::************>> at File$
        /boost/1.45.0/include/boost/concept/detail/general.hpp$
        line 56$
      While instantiating struct boost::concepts::not_satisfied<boost::concepts::usage_requirements<boost::Assignable<int>$
    >> at File /boost/1.45.0/include/boost/mpl/if.hpp$
        line 63$
                           _$
        TestBimap flintTest;$
    /boost/1.45.0/include/boost/concept/detail/has_constraints.hpp $
        44  Error 1015: Symbol 'constraints' not found in class$
    bimap.cpp  7  Info 831: Reference cited in prior message$
    /boost/1.45.0/include/boost/bimap/bimap.hpp $
        137  Info 831: Reference cited in prior message$
    /64bit/boost/1.45.0/include/boost/mpl/if.hpp $
        63  Info 831: Reference cited in prior message$
    /boost/1.45.0/include/boost/bimap/detail/bimap_core.hpp $
        90  Info 831: Reference cited in prior message$
    /boost/1.45.0/include/boost/concept_check.hpp $
        137  Info 831: Reference cited in prior message$
   /boost/1.45.0/include/boost/concept_check.hpp $
        139  Info 831: Reference cited in prior message$
    /boost/1.45.0/include/boost/concept/detail/general.hpp $
        54  Info 831: Reference cited in prior message$
    /boost/1.45.0/include/boost/concept/detail/general.hpp $
        56  Info 831: Reference cited in prior message$
    /boost/1.45.0/include/boost/bimap/detail/manage_bimap_key.hpp $
        69  Info 831: Reference cited in prior message$
    /boost/1.45.0/include/boost/bimap/set_of.hpp $
        130  Info 831: Reference cited in prior message$

我的FlexeLint版本是:

代码语言:javascript
复制
FlexeLint for C/C++ (Unix) Vers. 9.00i, Copyright Gimpel Software 1985-2012

我花了几个小时试图让它工作,但没有运气。有没有人遇到了同样的问题并有解决方案?这是配置错误吗?如果需要的话,我可以发布我的配置。

我将非常感谢你的帮助

诚挚的问候!

PS: flexelint tag please;>?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-11-23 20:29:22

对于那些和我遇到过同样问题的人。我直接问了Gimepl支持人员这个问题,他们回答说这是FlexeLint不能处理c++11可变模板的问题。因此,就目前而言,唯一的解决方法是通过-elib和-e选项抑制这些警告。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13381007

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档