审议一个类型的<代码>T和一个点至T
,T
。
是否有办法复制<代码>。 T* ,at a given address x
, without using memcpy (
and in a portable way?
Edit:
Just to be clear, I don t want to construct T
at address x
. I want to copy the value of the pointer to T
, T*
, at address x
, as in
char* p = new char[s];
memcpy(&p[0], t, sizeof(T*)); // t is T*