References to tr1 don't work with C++11
Library of generic, k-d tree multi-dimensional containers
Brought to you by:
bouhdevel
There are references to various names in the std::tr1 namespace; these do not work with C++11. Identified using: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Simply replacing all instances of std::tr1:: to std:: makes everything work. Thus,
#if __cplusplus <= 201103L
should make it possible to use C++11 as well as TR1 compilers.
Anonymous
Hi Ed,
I will look into fixing this issue into the next release. I've been dragging my feet about it, because I though I could make the switch to C++11 quite soon, but it's going to need a bit more work from me.
Anyway, it should be fix in the next few days.
Thanks for reporting this issue in any case.
Regards,
Sylvain
(edited: markdown got me...)
After my own testing it seems that neither GCC(4.9.1), Clang(3.5) nor Windows MSVC++(2012) actually declare that they are __cplusplus >= 201103L when compiling with C++11 switches.
But I think I originally misunderstood where your issue comes from. It not a C++11 issue, it's a libc++ vs. other libraries issue. Since you are on Apple, probably, you are using Xcode, which comes with libc++; not glibc++. Its probably what you were trying to explain but I focused on C++11 instead.
Long story short... My fix will look like that, and I believe that should solve your problem:
I have installed libc++ headers and ABI on my machine, and I can confidently reproduce the error you mention, so I'm going to make it a default test from now on... For the benefit of the Apple and libc++ users out there.
Let me know if you think the solution looks right to you.
Last edit: Sylvain Bougerel 2014-10-23
Wrong!
My own testing was wrong. They do define it, so I'm not sure what I did wrong when I tested. Anyway. I fixed it to:
Voila.
The new release 2.1.6 contains the fix to this issue. It introduces support for libc++ and C++11, so it should work for you.
Thanks for fully investigating this and fixing it! Much appreciated.