8
は打ち鳴らす(バージョン3.1、LLVM 3.1、DebianのGNU/LinuxのSID)を使用してコンパイルされたときに、次のエラーを生成しますクラン、STD ::のshared_ptrとstd ::未満/オペレータ<
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/shared_ptr.h:364:14: error: no matching function for call to object of type 'std::less<_CT>'
return std::less<_CT>()(__a.get(), __b.get());
^~~~~~~~~~~~~~~~
foo.cpp:9:21: note: in instantiation of function template specialization 'std::operator<<int, int>' requested here
bool result = ptr0 < ptr1;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/stl_function.h:236:7: note: candidate function not viable: no known conversion from 'int *' to 'int *&&&' for
1st argument;
operator()(const _Tp& __x, const _Tp& __y) const
^
同じコードをGCC(バージョン4.7.0)でコンパイルしてもエラーメッセージは表示されません。演算子<()がclangの共有ポインタに対して機能しない理由はありますか?
うわー、 'int * &&&' ... – kennytm