, , . - Uncopyable Derived.
, , std::vector. , , push_back . -, , , , , . . , , , .
- , , , , . , , , :
Derived Foo;
Derived Bar;
Foo = Bar
:
int GetAnswer(Derived bar)
{ }
Derived Foo;
int answer = GetAnser(Foo);
, foo GetAnswer.
, - . , , , , opengl, .. , , . , , .
: Uncopyable , . :
int GetAnswer(Derived& bar)
{ }
Derived Foo;
int answer = GetAnser(Foo);
, , . - , , .
: , , , , - .
, . , umakeable. , , , . , , , . , ++.
, , - - .
class uncreateable
{
uncreateable() {}
public:
static int GetImportantAnswer();
};
Looking at this, you can see that I do not need to instantiate the class to call GetImportantAnswer (), but I could not create the instance if I wanted to. I could call this code using the following:
int answer;
answer = uncreateable::GetImportantAnswer();
Edit: spelling and grammar