access violation with std::map (VS2015)
-
I need a sorted list of strings with some additional information for each entry, so I thought about to use std::map I am doing just simple things: Definition:
typedef std::map tTABMNEMO;
tTABMNEMO TabMnemo;and in constructor of using class I am calling firstly:
TabMnemo.clear();
already this first access (in constructor of using class) causes an access violation. any idea, what could be wrong? Do I need to initialize anyhow? maybe it is because of my program structure? this map is defined globally outside of the class and all the member functions of the using class are static functions!
-
I need a sorted list of strings with some additional information for each entry, so I thought about to use std::map I am doing just simple things: Definition:
typedef std::map tTABMNEMO;
tTABMNEMO TabMnemo;and in constructor of using class I am calling firstly:
TabMnemo.clear();
already this first access (in constructor of using class) causes an access violation. any idea, what could be wrong? Do I need to initialize anyhow? maybe it is because of my program structure? this map is defined globally outside of the class and all the member functions of the using class are static functions!
Member 8534035 wrote:
TabMnemo.clear();
Have you tried:
try
{
TabMnemo.clear();
}
catch(exception &e)
{
cout << e.what();
}Member 8534035 wrote:
...and all the member functions of the using class are static functions!
So have you tried using it in a class with non-static functions?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
I need a sorted list of strings with some additional information for each entry, so I thought about to use std::map I am doing just simple things: Definition:
typedef std::map tTABMNEMO;
tTABMNEMO TabMnemo;and in constructor of using class I am calling firstly:
TabMnemo.clear();
already this first access (in constructor of using class) causes an access violation. any idea, what could be wrong? Do I need to initialize anyhow? maybe it is because of my program structure? this map is defined globally outside of the class and all the member functions of the using class are static functions!