J
John Doe
Hi,
I have a static array of struct defined like this :
CViewMgr::ViewInfo g_ViewInfo[] =
{
{ EMainView, ECreateOnce, IDR_MAINFRAME, RUNTIME_CLASS(CMainView),
NULL,0, 0 },
{ EWelcomeView, ECreateAndDestroy, IDR_MENU_OKCANCEL,
RUNTIME_CLASS(CWelcomeView), NULL,0, 0 },
};
I would like to put all these declarations in a vector how can I do it ?
typedef std::vector<ViewInfo> ViewList;
ViewList viewList;
soemthing like :
for (int i = 0; i < _countof(g_ViewInfo); i++)
viewList.push_back(g_ViewInfo);
But I am sure there is an easier way, maybe I should call reserve before ?
I have a static array of struct defined like this :
CViewMgr::ViewInfo g_ViewInfo[] =
{
{ EMainView, ECreateOnce, IDR_MAINFRAME, RUNTIME_CLASS(CMainView),
NULL,0, 0 },
{ EWelcomeView, ECreateAndDestroy, IDR_MENU_OKCANCEL,
RUNTIME_CLASS(CWelcomeView), NULL,0, 0 },
};
I would like to put all these declarations in a vector how can I do it ?
typedef std::vector<ViewInfo> ViewList;
ViewList viewList;
soemthing like :
for (int i = 0; i < _countof(g_ViewInfo); i++)
viewList.push_back(g_ViewInfo);
But I am sure there is an easier way, maybe I should call reserve before ?