//// opt::copy// same semantics as std::copy// calls memcpy where appropriate.//namespacedetail{template<typenameI1,typenameI2,boolb>I2copy_imp(I1first,I1last,I2out,constboost::integral_constant<bool,b>&){while(first!=last){*out=*first;++out;++first;}returnout;}template<typenameT>T*copy_imp(constT*first,constT*last,T*out,constboost::true_type&){memmove(out,first,(last-first)*sizeof(T));returnout+(last-first);}}template<typenameI1,typenameI2>inlineI2copy(I1first,I1last,I2out){//// We can copy with memcpy if T has a trivial assignment operator,// and if the iterator arguments are actually pointers (this last// requirement we detect with overload resolution)://typedeftypenamestd::iterator_traits<I1>::value_typevalue_type;returndetail::copy_imp(first,last,out,boost::has_trivial_assign<value_type>());}