由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++ memcpy declaration use restrict keyword?
相关主题
class D:public B;forward declaration
关于C++ STL编译的疑问c++ initialize struct
Question about friend in C++a simple question about constructor
A C++ Question如何 initialize array member?
What is wrong in this array declaration.问一个 copy constructor 的问题 (C++)
请教有关header file的几个问题question about c++ constructor
typedef怎样include一个函数
qeustion about separation of interface and implementation in javaoverload "++i"里的operator“++”,怎么declare?
相关话题的讨论汇总
话题: keyword话题: restrict话题: c++话题: memcpy话题: use
进入Programming版参与讨论
1 (共1页)
H****r
发帖数: 2801
1
How come this function declared differently by different compilers?
It seems that VS2010 does not use this keyword?
t****t
发帖数: 6806
2
memcpy规定源和目的不能overlap, 和restricted目的一样. 所以有restricted就可以
加上, 没有也没关系, 就靠程序员自觉了.

【在 H****r 的大作中提到】
: How come this function declared differently by different compilers?
: It seems that VS2010 does not use this keyword?

f*****e
发帖数: 2992
3
可以overlap的那个函数是什么?忘了。

【在 t****t 的大作中提到】
: memcpy规定源和目的不能overlap, 和restricted目的一样. 所以有restricted就可以
: 加上, 没有也没关系, 就靠程序员自觉了.

H****r
发帖数: 2801
4
个人理解是可以加的啊,但是这个函数是在string.h里定义好的,而且有的document里
说是已经改成restricted的了, 而有的还是没有这个关键字...

【在 t****t 的大作中提到】
: memcpy规定源和目的不能overlap, 和restricted目的一样. 所以有restricted就可以
: 加上, 没有也没关系, 就靠程序员自觉了.

H****r
发帖数: 2801
5
memmove?

【在 f*****e 的大作中提到】
: 可以overlap的那个函数是什么?忘了。
t****t
发帖数: 6806
6
that doesn't matter to you, does it? you are not supposed to modify it
anyway. just use it as you will normally do.

【在 H****r 的大作中提到】
: 个人理解是可以加的啊,但是这个函数是在string.h里定义好的,而且有的document里
: 说是已经改成restricted的了, 而有的还是没有这个关键字...

nr
发帖数: 67
7
y

【在 H****r 的大作中提到】
: memmove?
H****r
发帖数: 2801
8
主要是影响个人对这个关键字的理解,感觉说明档和实际实现不同了。后来查了下发现
好像这个问题是Visual Studio貌似不用这个关键字,囧...

【在 t****t 的大作中提到】
: that doesn't matter to you, does it? you are not supposed to modify it
: anyway. just use it as you will normally do.

k**********g
发帖数: 989
9
__restrict
to be applied to a local variable that is a pointer, inside a function body.
1 (共1页)
进入Programming版参与讨论
相关主题
overload "++i"里的operator“++”,怎么declare?What is wrong in this array declaration.
ask a question about compile shared library using libtool请教有关header file的几个问题
const char *p, is it ok to change p[1] ?typedef
One question in C programmingqeustion about separation of interface and implementation in java
class D:public B;forward declaration
关于C++ STL编译的疑问c++ initialize struct
Question about friend in C++a simple question about constructor
A C++ Question如何 initialize array member?
相关话题的讨论汇总
话题: keyword话题: restrict话题: c++话题: memcpy话题: use