0

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;}
Community
  • 1
  • 1
Resurrection
  • 3,916
  • 2
  • 34
  • 56
  • GCC 4.9.2 doesn't support for C++14 fully, so it's good that [`std::remove_reference`](http://en.cppreference.com/w/cpp/types/remove_reference) is part of C++11 which GCC 4.9.2 support pretty well. However, that lacking C++14 support might mean that your config might not be good, and you need to specify C++11 explicitly? For example by making sure you build with the `-std=c++11` flag. – Some programmer dude Mar 18 '16 at 06:44
  • Shouldn't it be `CONFIG += c++14` with a non-capital `c`? Also, take a look at the g++ flags during compilation to see if `-std=c++14` is there. – Romário Mar 18 '16 at 22:18

0 Answers0