葛丽塔C++;VC11未定义结构 我正在把VS2002 C++项目升级到VS2013。该项目使用GRETA regex库。据我所见,它没有维护,我在任何地方都找不到更新版本。我想改变我的项目尽可能少,所以我不想取代格雷塔

葛丽塔C++;VC11未定义结构 我正在把VS2002 C++项目升级到VS2013。该项目使用GRETA regex库。据我所见,它没有维护,我在任何地方都找不到更新版本。我想改变我的项目尽可能少,所以我不想取代格雷塔,c++,visual-studio-2013,C++,Visual Studio 2013,restack.h(原件) 名称空间详细信息 { //对于生成 //没有运行时开销。 模板struct static\u assert; 模板结构static_assert{static_assert(){}; //解决VC7.0上的模板参数问题 模板struct type2type{typedef T type;}; 模板struct bool2type{enum{value=F};}; typedef bool2type true\u t; typedef bool2type false\t

restack.h(原件)

名称空间详细信息
{
//对于生成
//没有运行时开销。
模板struct static\u assert;
模板结构static_assert{static_assert(){};
//解决VC7.0上的模板参数问题
模板struct type2type{typedef T type;};
模板struct bool2type{enum{value=F};};
typedef bool2type true\u t;
typedef bool2type false\t;
restack.h(修改)

namespace regex
{
名称空间详细信息
{
//对于生成
//没有运行时开销。
模板struct\u static\u assert;
模板结构t_static_assert{t_static_assert(){};
//解决VC7.0上的模板参数问题
模板struct type2type{typedef T type;};
模板struct bool2type{enum{value=F};};
typedef bool2type true\u t;
typedef bool2type false\t;
我觉得我遇到了一个问题,因为static_assert是VC11中的一个关键字,而不是VC6中的关键字。因此我在前面添加了t_。现在我在regexpr2.h中遇到了以下编译器错误:

 error C2079: 'iterator_types_are_not_convertible' uses undefined
 struct 'regex::detail::t_static_assert<false>'
错误C2079:“迭代器类型不可转换”使用未定义的
结构'regex::detail::t_static_assert'
regexpr2.h(已修改)

//如果编译在这里中断,那是因为CharT*不是
//可转换为IterT类型。请检查rpattern对象的声明。
detail::t_static_assertconst迭代器_type_不_convertable;
(void)迭代器类型不可转换;
格丽塔可在此访问:


我如何着手解决这个问题?

静态断言是C++11的一部分-其目的是提供编译时断言其中一个静态断言失败了-特别是
detail::is\u convertible
。不知道这些类型是什么,我们无法真正说明此测试失败的原因。我知道静态断言是C++11的一部分,但它是其中的一部分吗关于VC6?我认为在编写库时它是在不同的环境中使用的。我现在了解了一些。代码是在静态断言存在之前编写的,所以看起来他们试图实现自定义版本。我删除了所有这些,并切换到内置版本。我发现了导致问题的代码行,但不理解这是微软的老代码,可能不值得再使用了。
namespace regex
{

    namespace detail
    {

        // For compile-time assertions that generate
        // no run-time overhead.
        template< bool f > struct t_static_assert;
        template<>         struct t_static_assert < true > { t_static_assert() { } };

        // Work-around for a template-template parameter problem on VC7.0
        template< typename T > struct type2type { typedef T type; };

        template< bool F > struct bool2type { enum { value = F }; };

        typedef bool2type<true>  true_t;
        typedef bool2type<false> false_t;
 error C2079: 'iterator_types_are_not_convertible' uses undefined
 struct 'regex::detail::t_static_assert<false>'
// If your compile breaks here, it is because CharT* is not
// convertible to type IterT. Check the declaration of your rpattern object.
detail::t_static_assert< detail::is_convertible<CharT*, IterT>::value > const iterator_types_are_not_convertible;
( void ) iterator_types_are_not_convertible;