Restrict pointers?

F

Frederick Gotham

I did a search through the C++ Standard there, and couldn't find any
mention of "restrict" or "__restrict__". Firstly, could someone please
confirm whether "restrict" is mentioned in the C++ Standard?

A quick search of the web shows up a few pages which imply that C++ has a
"__restrict__" keyword... is there any truth to this?


Basically my question is:

Does C++ have restrict pointers?
 
T

TB

Frederick Gotham skrev:
I did a search through the C++ Standard there, and couldn't find any
mention of "restrict" or "__restrict__". Firstly, could someone please
confirm whether "restrict" is mentioned in the C++ Standard?

A quick search of the web shows up a few pages which imply that C++ has a
"__restrict__" keyword... is there any truth to this?


Basically my question is:

Does C++ have restrict pointers?

No, only C99 has the keyword restrict, not C++, unless
provided as a compiler extension.
 
B

Bo Persson

Frederick Gotham said:
I did a search through the C++ Standard there, and couldn't find any
mention of "restrict" or "__restrict__". Firstly, could someone
please
confirm whether "restrict" is mentioned in the C++ Standard?

A quick search of the web shows up a few pages which imply that C++
has a
"__restrict__" keyword... is there any truth to this?


Basically my question is:

Does C++ have restrict pointers?

No, that is a C99 feature.

It would also be less useful in C++, where passing multiple pointers
to primitive types is less common. Parameters of different class types
are already known not to have an alias problem.


Bo Persson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top