Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++)type qualifiers ignored on function return type

 

Compile warning.

 

 

 

 

 

Full warning message

 

main.cpp:2: warning: type qualifiers ignored on function return type

 

 

 

 

 

Cause

 

IDE: Qt Creator 1.2.1

Compiler: G++ 4.4.1

Project type: Qt4 Console Application

 

template <typename T> const T Do();
template <> const int Do();

 

 

 

 

 

Solution

 

Unknown. Removing the constness in the integer return type results in a compile error.

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict