Mantis - ALGLIB
Viewing Issue Advanced Details
400 AlgoPascal minor have not tried 2011-06-24 10:39 2018-01-03 08:47
armin  
SergeyB  
normal  
assigned 3.3.0  
open  
none    
none  
C++
0000400: Compiler warning in ap.h
Using gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5), I get the following warning:

ap.h:719: warning: type qualifiers ignored on function return type
ap.h:720: warning: type qualifiers ignored on function return type

These are the two lines:
const bool operator==(const alglib::complex& lhs, const alglib::complex& rhs);
const bool operator!=(const alglib::complex& lhs, const alglib::complex& rhs);

I guess the const flag can be savely removed for bool return values.
Issue History
2011-06-24 10:39 armin New Issue
2011-06-24 10:39 armin Programming language => C++
2018-01-02 17:23 SergeyB Status new => assigned
2018-01-02 17:23 SergeyB Assigned To => SergeyB
2018-01-03 08:47 zaytsev Note Added: 0000070

Notes
(0000070)
zaytsev   
2018-01-03 08:47   
It doesn't have anything to do with booleans per se, but rather with non-class (POD) rvalues:

https://stackoverflow.com/questions/1607188/why-is-a-type-qualifier-on-a-return-type-meaningless

But yes, the bottom line is that the const qualifier can be safely removed in this situation.