On Thu, May 15, 2014, at 02:47 PM, Johan Engelen wrote:
Hi Krzysz, The following lines in ui/tool/node.h are causing trouble with gcc 4.9 C++11:
#if HAVE_TR1_UNORDERED_SET namespace std { namespace tr1 { template <typename N> struct hash< Inkscape::UI::NodeIterator<N> >; } } #endif
Is it OK to remove those? If I comment them out, all seems to work fine. I cannot find the specialization definition anywhere, so seems only a fwd decl?
Yes, that is a forward declaration. However the first thing to check is if your build is configured such that HAVE_TR1_UNORDERED_SET is actually defined (you might see in your config.h). One prime gotcha with #ifdef code is that unless you have the code being touched as live, it's easy to think something is safe to do when it will actually break things for other people.
That said, doing a forward declaration of a template provided in a library that we don't control is not a good practice, as you've now seen first-hand. Some judicious refactoring should be able to correct that without bringing in too much of a negative impact for others.