I'm trying to learn about C++11 disabling constructors, so i downloaded and installed VS11 Ultimate Beta.
When i try to compile my little code i got errors. This is the code:
I see.
There is a way to store inside a vector a normal class and not its copy?
Some1, some month ago, said me that it's possible to do disabling copy constructor and assign op.
I'm tring something like this:
1 2 3 4 5 6 7
int main()
{
std::vector<MyClass> vect;
vect.push_back(MyClass(23,"Prova"));
system ("PAUSE");
return EXIT_SUCCESS;
}
But it will create a class then vect will store a copy of MyClass.
MS VC++ is a very bad compiler! Apart from that it does not support many features of the C++ 11, it has many bugs that are not being fixed during many years. So if there is a possibility to use another compiler then use it!
An example of the very old bug of the compiler
#include "stdafx.h"
class A
{
public:
A() {}
private:
A( const A & );
};
class B : public A
{
};
class C
{
A a;
};
int _tmain(int argc, _TCHAR* argv[])
{
B b = B();
C c = C();
return 0;
}
That is a pretty heinous bug. It might lead you to believe that:
1 2 3 4
B b ;
C c ;
B b2(b) ;
C c2(c) ;
would compile, but, of course, it doesn't. Who knows why that one particular bug hasn't been top priority? It's clearly disabling. I don't know how people manage to code productively with a bug like this.
Gcc support deleting copy constructors :P
It's time to change compiler!
IT is possible to use VS and GCC? I think VS's debugging is the best on net! Am i wrong?