1 | initial version |
I can't tell why the error is raised, but it is definitely not because missing copy constractor.
Even if there is no explicitely defined copy constractor or assignment operator, it doesn't mean that they do not exist. Your compiler will generate them for you. In fact making uncopyable class is quite a tricky task (you have to explicitely declare them 'private'). If that wasn't the case you couldn't pass your object to function, because this requires copy of the object (unless you pass it by reference).
If you want to get better understanding of implicitly generated functions I recommend you to read Scott Meyers book "Effective C++", items 5 and 6 ("Know what functions C++ silently writes and calls" and "Explicitly disallow the use of compiler-generated functions you do not want").
2 | No.2 Revision |
I can't tell why the error is raised, but it is definitely not because missing copy constractor.
Even if there is no explicitely defined copy constractor or assignment operator, it doesn't mean that they do not exist. Your compiler will generate them for you. In fact making uncopyable class is quite a tricky task (you have to explicitely declare them 'private'). If that wasn't the case you couldn't pass your object to function, because this requires copy of the object (unless you pass it by reference).
If you want to get better understanding of implicitly generated functions I recommend you to read Scott Meyers book "Effective C++", items 5 and 6 ("Know what functions C++ silently writes and calls" and "Explicitly disallow the use of compiler-generated functions you do not want").want"). The best book on C++ I ever read.
3 | No.3 Revision |
I can't tell why the error is raised, thrown, but it is definitely not because of missing copy constractor.
Even if there is no explicitely defined copy constractor or assignment operator, it doesn't mean that they do not exist. Your compiler will generate them for you. In fact making uncopyable class is quite a tricky task (you have to explicitely declare them 'private'). If that wasn't the case you couldn't pass your object to function, because this requires copy of the object (unless you pass it by reference).
If you want to get better understanding of implicitly generated functions I recommend you to read Scott Meyers book "Effective C++", items 5 and 6 ("Know what functions C++ silently writes and calls" and "Explicitly disallow the use of compiler-generated functions you do not want"). The best book on C++ I ever read.
4 | No.4 Revision |
I can't tell why the error is thrown, but it is definitely not because of missing copy constractor.
Even if there is no explicitely defined copy constractor or assignment operator, it doesn't mean that they do not exist. Your compiler will generate them for you. In fact making uncopyable class is quite a tricky task (you have to explicitely explicitly declare them 'private'). If that wasn't the case you couldn't pass your object to function, because this requires copy of the object (unless you pass it by reference).
If you want to get better understanding of implicitly generated functions I recommend you to read Scott Meyers book "Effective C++", items 5 and 6 ("Know what functions C++ silently writes and calls" and "Explicitly disallow the use of compiler-generated functions you do not want"). The best book on C++ I ever read.
5 | No.5 Revision |
I can't tell why the error is thrown, but it is definitely not because of missing copy constractor.constractor. They do exist.
Even if there is no explicitely explicitly defined copy constractor or assignment operator, it doesn't mean that they do not exist. Your compiler will generate them for you. If that wasn't the case you couldn't pass your object to function, because function should get a copy of object (if not passed by reference). In fact making uncopyable class is quite a tricky task (you have to explicitly declare them 'private'). If that wasn't the case you couldn't pass your object copy/assignment to function, because this requires copy of the object (unless you pass it by reference).be 'private' functions).
If you want to get better understanding of implicitly generated functions I recommend you to read Scott Meyers book "Effective C++", items 5 and 6 ("Know what functions C++ silently writes and calls" and "Explicitly disallow the use of compiler-generated functions you do not want"). The best book on C++ I ever read.
6 | No.6 Revision |
I can't tell why the error is thrown, but it is definitely not because of missing copy constractor. constractors. They do exist.
Even if there is no explicitly defined copy constractor or assignment operator, it doesn't mean that they do not exist. Your compiler will generate them for you. If that wasn't the case you couldn't pass your object to function, because function should get a copy of object (if not passed by reference). In fact making uncopyable class is quite a tricky task (you have to explicitly declare copy/assignment to be 'private' functions).
If you want to get better understanding of implicitly generated functions I recommend you to read Scott Meyers book "Effective C++", items 5 and 6 ("Know what functions C++ silently writes and calls" and "Explicitly disallow the use of compiler-generated functions you do not want"). The best book on C++ I ever read.