I'm trying to specialize template member function. The problem is that in Debug mode calls specialization of method, but in Release calls non-specialized function.
For example, I have class template and specialized method
template <typename T>
void doSomething(const T& arg)
std::cout << "doSomething(const T& arg)" << std::endl;
void SimpleClass<double>::doSomething(const double& arg)
std::cout << "doSomething(const double& arg)" << std::endl;
int main(int argc, char **argv)
I'm expecting, that output will
"doSomething(const double& arg)".
So in Debug mode I got it, but in Release I got this:
"doSomething(const T& arg)"
My question is why that code behave this way and how can I fix it?
Just in case, my .pro file
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
SOURCES += main.cpp \
HEADERS += \
edit: I'm using Qt 5.9.1
#include <iostream> before using