Update: This question was answered by Igor in the comments. Turns out I missed the const
in my copy-constructor.
I am writing a class that can be stored in an unordered_map
, and everything appears to be syntactically correct. When I compile however, the compiler returns some strange errors that seem to have something to do with __is_direct_constructible_new
. The error also suggested to try compiling as -ftemplate-backtrace-limit=0
, but this caused another error so I'd rather not mess with the compiler flags and instead find the source of the problem.
That being said, my question is: What should I add to make my class "direct constructible"?
I'm including a generalized sample of the class below.
I tried following some of the relevant-sounding suggestions in this post, but those didn't help.
I also made sure that the issue was not being caused by the key or the key's hash.
I've never ran into this before so I'm not sure exactly sure how to make the class direct constructible.
Here is a generalized version of the class I'm referring to:
class Data
{
public:
// variables
// pointers
// member functions
Data(); // Sets variables to 0 and pointers to NULL
Data(ifstream& dataFile); // Initializes from a file
Data(Data& original); // Copy constructor
~Data();
};
If it makes a difference, I tried compiling on both MinGW 32bit and a 64bit version of MinGW 4.8.3 from here.