
On 17/11/12 15:52, Daniel James wrote:
On 17 November 2012 14:31, Peter Dimov <lists@pdimov.com> wrote:
What parts of SmartPtr don't work with clang/libstdc++?
There are calls to std::forward in boost/smart_ptr/make_shared_array.hpp, and boost/smart_ptr/allocate_shared_array.hpp that check for compiler support but not library support. I don't know if there's an appropriate config macro.
Personally I recommend avoiding std::forward, at least for code that needs to be compatible with other than the best and latest compilers. It adds an unnecessary dependency on a library component, is not very useful (static_cast<T&&>(t) looks essentially the same as std::forward<T>(t)), and it adds an uncessary function call, which means bloat and debugging annoyances.
This is only an issue with older versions of libstdc++ in C++11 mode, so I don't think it's a common problem. I only came across it in Boost.Test because I was trying to recreate an error people were seeing. For normal development, I'd never do it.
It probably also affects other compilers that have C++11 but no C++11 standard library, like xlC.