English 中文(简体)
法定地图初始动力功能错误
原标题:Static map initializer function error

我发现以下基点错误:

1>c:program filemicrosoft视觉演播室10.0vcincludeutility(163): 错误C2436:第二:成员功能或建筑初步化器清单中的nes类

以及很多次官——我根本不知道什么地方会看或什么会错。 (我知道它的职能是什么,但我对为什么不工作视而不见)

标题部分:

typedef void *DuplicateFn(pTree&, const pTree&); 
enum DuplicateTy {
    SKIP,
    OVERWRITE,
    ASK
};
typedef std::map<DuplicateTy, DuplicateFn> DuplicateMapTy;

static const DuplicateMapTy DuplicateFns;
static DuplicateMapTy DuplicateFns_INIT();

详细名称:

namespace detail {
    void OverWriteFn(GMProject::pTree& tOut, const GMProject::pTree& tIn);
    void AskFn(GMProject::pTree&  tOut, const GMProject::pTree& tIn);
}

来源部分:

GMProject::DuplicateMapTy GMProject::DuplicateFns_INIT() {
    DuplicateMapTy tmp;
    auto p(std::make_pair(GMProject::OVERWRITE, &detail::OverWriteFn));
    tmp.insert(p); //offending line
    return tmp;
}
const GMProject::DuplicateMapTy GMProject::DuplicateFns(GMProject::DuplicateFns_INIT());

正如我这样说,我为什么要把这air在地图上? I m 只是插入一个功能点灯和灯;一个 en?

问题回答

我可能错了,但我不喜欢:

auto p(std::make_pair(GMProject::OVERWRITE, &detail::OverWriteFn));

你们是否使用《2010年基本标准》? 您可以 h取变量名称(p),并看上去哪一种类型的auto

此外,你还尝试:

 tmp.insert(std::make_pair(GMProject::OVERWRITE, &detail::OverWriteFn));

tmp.insert(std::pair(GMProject::OVERWRITE, &detail::OverWriteFn));

?





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签