2013年8月3日土曜日

Cpp VC++ で std::copy を使おうとすると C4996エラーになるので回避

以下のコードで回避。
template<class II, class OI> inline OI std_copy(II in, II end, OI out) {
for (; in != end; ++in, ++out) *out = *in;
return out;
}
int main() {
int a [] = {1, 2, 3};
int b [] = {4, 5, 6};
std_copy(a, a + 3, b);
}
view raw gistfile1.cpp hosted with ❤ by GitHub

0 件のコメント:

コメントを投稿