This one is pretty strange. Previously I used Qt 5.5 with MinGW with MinGW 4.9.2 and with that I successfully used remove_reference_t
typedef. Now I have upgraded to Qt 5.6 that also uses MinGW 4.9.2 but the compiler complains that there is no remove_reference_t
. Looking at the docs it clearly states that this typedef is available since C++14 and I do actually use CONFIG += C++14
in all of my Qt *.pro files. For now I just spelled out that typedef myself but it confuses me a lot that it worked in previous version and it does not work in the new one despite it using the same compiler version. Any idea what the problem might be?
To clarify how I use it. It is a solution from this answer to one of my previous questions:
#include <type_traits>
template<class T>
std::remove_reference_t<T> const& as_const(T&&t){return t;}