дано:
ubuntu 14.04
clang++3.5
class PointF
{
void InitQPointF() const;
void CopyMembersFrom(const Gdiplus::PointF& point);
PointF(const Gdiplus::PointF& point) noexcept;
PointF& operator=(const Gdiplus::PointF& point);
public:
QPointF getQPointF() const;
PointF() noexcept;
PointF(REAL x,REAL y) noexcept;
PointF(const Gdiplus::SizeF& size) noexcept;
PointF(Gdiplus::PointF&&) = default;
BOOL Equals(const Gdiplus::PointF& point) const;
PointF operator-(const Gdiplus::PointF& point) const;
PointF operator+(const Gdiplus::PointF& point) const;
PointF& operator=(Gdiplus::PointF&&) = default;
REAL X;
REAL Y;
~PointF();
};
...
static PointF Cvt(const POINTF& p)
{
returnPointF(p.x, p.y);
}
...
std::vector<Color> gcolors;
....
gcolors.push_back(Cvt(*i));
проблема в принципе понятна, нет специализации для
false std::__uninitialized_copy<false>
1)не понятно, почему нет реализации false?
2) по правилам с++ не помню должна ли быть для false специализация или должен использоваться общий шаблон?
на g++4.7 проблем нет, все собирается
сообщение об ошибке:
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/stl_uninitialized.h:125:2: error: no member named '__uninit_copy' in 'std::__uninitialized_copy<false>'
__uninit_copy(__first, __last, __result);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/stl_uninitialized.h:278:19: note: in instantiation of function template specialization
'std::uninitialized_copy<std::move_iterator<PointF *>, PointF *>' requested here
{ return std::uninitialized_copy(__first, __last, __result); }
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/stl_uninitialized.h:299:19: note: in instantiation of function template specialization
'std::__uninitialized_copy_a<std::move_iterator<PointF *>, PointF *, PointF>' requested here
return std::__uninitialized_copy_a
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/vector.tcc:421:15: note: in instantiation of function template specialization 'std::__uninitialized_move_if_noexcept_a<PointF
*, PointF *, std::allocator<PointF> >' requested here
= std::__uninitialized_move_if_noexcept_a
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/vector.tcc:101:4: note: in instantiation of function template specialization 'std::vector<PointF,
std::allocator<PointF> >::_M_emplace_back_aux<PointF>' requested here
_M_emplace_back_aux(std::forward<_Args>(__args)...);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/stl_vector.h:932:9: note: in instantiation of function template specialization 'std::vector<PointF,
std::allocator<PointF> >::emplace_back<PointF>' requested here
{ emplace_back(std::move(__x)); }
^
note: in instantiation of member function 'std::vector<PointF, std::allocator<PointF> >::push_back' requested here
gpoints.push_back(Cvt(*i));
код из stl 4.9
#if __cplusplus < 201103L
const bool __assignable = true;
#else
// trivial types can have deleted assignment
typedef typename iterator_traits<_InputIterator>::reference _RefType;
const bool __assignable = is_assignable<_ValueType1, _RefType>::value;
#endif
return std::__uninitialized_copy<__is_trivial(_ValueType1)
&& __is_trivial(_ValueType2)
&& __assignable>::
__uninit_copy(__first, __last, __result);
добавил ассерты в код, падают ....
static_assert(__is_trivial(Gdiplus::Color));
static_assert(__is_trivial(Gdiplus::Color*));