![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I just installed 2.0.0 Beta 2 on a Fedora Core 4 system. I am getting the following warning: /usr/local/include/mysql++/noexceptions.h: In member function mysqlpp::NoExceptions& mysqlpp::NoExceptions: perator=(constmysqlpp::NoExceptions&): /usr/local/include/mysql++/noexceptions.h:129: warning: no return statement in function returning non-void |
#3
| |||
| |||
|
|
private: OptionalExceptions& assoc_; bool exceptions_were_enabled_; // Hidden assignment operator and copy ctor, because we should not // be copied. NoExceptions(const NoExceptions&); NoExceptions& operator=(const NoExceptions&) { } As defined in that last line, operator= should return a NoExceptions reference but it does not. I am not an expert programmer, should the "{ }" just become ";" ? |
#4
| |||
| |||
|
|
The latest SVN version has this "fixed", but incorrectly in my opinion. It currently just returns *this, whereas I don't think operator=() should be defined at all, just declared. |
#5
| |||
| |||
|
|
Chris Frey wrote: The latest SVN version has this "fixed", but incorrectly in my opinion. It currently just returns *this, whereas I don't think operator=() should be defined at all, just declared. Does this actually suppress the compiler-generated version? |
perator=(const A&)' is private
perator=() for us.|
Regardless, operator= does normally return *this, so the only problem with doing it this way is that it generates a tiny bit more code than if it were only declared and not defined. |
![]() |
| Thread Tools | |
| Display Modes | |
| |