473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Using __restrict__ on a class member variable

SzH

I understand that __restrict__ is a gcc extension, and not in the
official standard, but I got no reply on the gcc-help mailing list.
Since more people are reading this newsgroup, there is a greater
probability that someone can offer his/her help here.

First question:

Is it possible to use the __restrict__ qualifier on a member
variables, like in the example below (with gcc)?

class array {
double * __restrict__ data;
....
....
};

The compiler gives no error message, but does declaring data as
a__restrict__ed pointer have any effect on functions that accept
references to arrays as arguments?

The gcc documentation only mentions using __restrict__ on function
arguments or member functions. [1] In this case only the a single
function is affected.

Second question:

If this does not work, how can I achieve the same effect as with

void fun(double * __restrict__ arr1, double * __restrict__ arr2)
{ ... }

if I use array & instead of double *?

[1] http://gcc.gnu.org/onlinedocs/gcc-4....-pointers-2455

Apr 24 '07 #1
3 3159
SzH wrote:
I understand that __restrict__ is a gcc extension, and not in the
official standard, but I got no reply on the gcc-help mailing list.
Since it's not a standard modifier/qualifier, any discussion on it
would be off-topic here. Have you tried 'gnu.g++.help'?
Since more people are reading this newsgroup, there is a greater
probability that someone can offer his/her help here.
Yes, and most readers here are men. Would there be a greater
probability that someone can offer help on male hygene here?..
Whether there is or there isn't does not make questions on male
hygene on topic. :-/
[..]
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 24 '07 #2
SzH
Victor Bazarov wrote:
Since it's not a standard modifier/qualifier, any discussion on it
would be off-topic here. Have you tried 'gnu.g++.help'?
I didn't know about gnu.g++.help before. I will post there.
>Since more people are reading this newsgroup, there is a greater
probability that someone can offer his/her help here.

Yes, and most readers here are men. Would there be a greater
probability that someone can offer help on male hygene here?..
Whether there is or there isn't does not make questions on male
hygene on topic. :-/
Don't be rude. My question was still much more closely related to
(standard) C++ than male hygiene. At least I learned about gnu.g++.help
now so it was not a completely bad idea to post here.
Apr 24 '07 #3
SzH <sz******@gmail.comwrote in
news:11**********************@t39g2000prd.googlegr oups.com:
>
I understand that __restrict__ is a gcc extension, and not in the
official standard, but I got no reply on the gcc-help mailing list.
Since more people are reading this newsgroup, there is a greater
probability that someone can offer his/her help here.
Wrong. Far greater probability that someone on gcc-help will know. Even
worse that you _know_ that you're off-topic, and know a more appropriate
place to ask, yet to persisted on asking here.

Apr 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: pvdm | last post by:
Hi, I am writing an app which encapsulates a multimedia timer. I implemented a TimerProc as static member function and a static member variable pThis as pseudo this variable to access in the...
1
by: Nobody You Know | last post by:
I need a member variable in class A known within an instance of class B, even though B does not instantiate A. My solution was to make the member variable private static, and create a public...
30
by: Neil Zanella | last post by:
Hello, Suppose I have some method: Foo::foo() { static int x; int y; /* ... */ }
7
by: Abhi | last post by:
Hi all, I am using .net for C++ and I would like to write some variable values to some files. I will be using that file in many member functions of the class. So I declared the file variable...
11
by: Brent Ritchie | last post by:
Hello all, I have been using C# in my programming class and I have grown quite fond of C# properties. Having a method act like a variable that I can control access to is really something. As...
1
by: mangalalei | last post by:
A static data member can be of the same class type as that of which it is a member. A nonstatic data member is restricted to being declared as a pointer or a reference to an object of its class. ...
1
by: sk.rasheedfarhan | last post by:
Hi , I am using C# I am having 4 classes. like below. public class A { String m_strRuleName; String m_strRuleGuid; // Some member functions. public Object NextItem; }
9
by: Jess | last post by:
Hello, I was told that if I declare a static class constant like this: class A{ static const int x = 10; }; then the above statement is a declaration rather than a definition. As I've...
15
by: Bob Johnson | last post by:
I have a base class that must have a member variable populated by, and only by, derived classes. It appears that if I declare the variable as "internal protected" then the base class *can*...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.