When are compiler generated functions generated?
Suppose I had this class:
class NonCopyable
{
private:
NonCopyable(const NonCopyable&);
NonCopyable& operator=(const NonCopyable&);
};
//////////////////////////////////////////////////////////
// BigClass.h
class BigClass : NonCopyable
{
private:
typedef std::vector<Widget> VecWidget;
typedef std::set<VecWidget> VecWidgetSet;
typedef std::multi_map<DooDad, VecWidgetSet> OneReallyUglyMap;
OneReallyUglyMap m_reallyUglyMap;
};
/////////////////////////////////////////////////////////////////////////////
In my project, there are 100 .CPP files that include BigClass.h. As
the code indicates, the class is never copied.
Is the compiler going to go ahead and generate a copy constructor and
assignment operator, even though I don't want or need one?
If the compiler is going to generate these functions, will it generate
these functions once, or for every .CPP file that includes this?
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]