473,396 Members | 1,914 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,396 software developers and data experts.

membres statiques est spécialisations partielles de classes

AG
Bonjour,

voici mon bout de code (toujours le même en amélioré). Ma question est la
suivante :

combien de tableau tab ai-je ? Moi j'en veux que deux. Un pour myA1 et un
pour myA2. Le fait que je sois obligé de spécialiser l'instanciation du
tableau statique tab me fait penser que j'aurais 12 tableau en tout. Est-ce
bien ça ?

D'avance merci.

Alexandre.
#define D 5

const int L=10;

template <class T,bool S,int N=0class A
{
static T tab[D*L];
A<T,S,N+1next;
public:
void f(void)
{
for(int i=0;i<L;i++) tab[N*L+i+1]+=tab[N*L+i];
next.f();
};
};

template<class T,bool Sclass A<T,S,D>
{
static T tab[D*L];
public:
void f(void)
{
for(int i=0;i<S;i++) tab[D*L+i+1]+=tab[D*L+i];
};
};
template<class T, bool S,int N>
T A<T,S,N>::tab[D*L]={0};

template<class T, bool S>
T A<T,S,D>::tab[D*L]={0};

int main(void)
{
A<int,truemyA1;
A<int,falsemyA2
myA1.f();
myA2.f();
}
Aug 10 '07 #1
6 1269
"AG" <ag@tb.frwrites:
Bonjour,
Hello.
voici mon bout de code (toujours le même en amélioré). Ma question est la
suivante :
[...]
template <class T,bool S,int N=0class A
{
static T tab[D*L];
A<T,S,N+1next;
public:
[...]

This newsgroup uses English. You might want one of the fr.*
newsgroups. Or, if your English is good enough, try comp.lang.c++;
your code is C++, not C.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Aug 10 '07 #2
AG
"Keith Thompson" <ks***@mib.orga écrit dans le message de news:
ln************@nuthaus.mib.org...
This newsgroup uses English. You might want one of the fr.*
newsgroups. Or, if your English is good enough, try comp.lang.c++;
your code is C++, not C.
thank you Keith for the answer. I made a mystake sending my post.
Tried to cancel the post, but apparently it didn't work. My
appologies.

AG.

Aug 13 '07 #3
"AG" <ag@tb.frwrites:
"Keith Thompson" <ks***@mib.orga écrit dans le message de news:
ln************@nuthaus.mib.org...
>This newsgroup uses English. You might want one of the fr.*
newsgroups. Or, if your English is good enough, try comp.lang.c++;
your code is C++, not C.

thank you Keith for the answer. I made a mystake sending my
post. Tried to cancel the post, but apparently it didn't work. My
appologies.
No problem. Cancels typically don't work; they're not authenticated,
and forged cancels have caused most servers to ignore all cancels.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Aug 13 '07 #4
AG wrote:
"Keith Thompson" <ks***@mib.orga écrit dans le message de news:
ln************@nuthaus.mib.org...
>This newsgroup uses English. You might want one of the fr.*
newsgroups. Or, if your English is good enough, try comp.lang.c++;
your code is C++, not C.

thank you Keith for the answer. I made a mystake sending my post. Tried
to cancel the post, but apparently it didn't work. My appologies.
It did cancel on my newsgroup server. Just curious, do French speaking
newsgroups have grammatical standards?
Aug 13 '07 #5
AG
It did cancel on my newsgroup server. Just curious, do French speaking
newsgroups have grammatical standards?
no idea.
Aug 13 '07 #6
Tim Prince <ti***********@sbcglobal.netwrites:
[snip]
It did cancel on my newsgroup server.
Cancels are done by sending a specially formatted article. Probably
your server accepted it and tried to pass it on to other servers, but
other servers ignored it.

The solution is to think before you post (a rule I don't always follow
myself).
Just curious, do French
speaking newsgroups have grammatical standards?
I think you've managed to find *exactly* the wrong place to ask that
question. 8-)}

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Aug 13 '07 #7

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

Similar topics

12
by: David MacQuigg | last post by:
I have what looks like a bug trying to generate new style classes with a factory function. class Animal(object): pass class Mammal(Animal): pass def newAnimal(bases=(Animal,), dict={}):...
16
by: Simon Wittber | last post by:
I've noticed that a few ASPN cookbook recipes, which are recent additions, use classic classes. I've also noticed classic classes are used in many places in the standard library. I've been...
2
by: | last post by:
I have this class ------------- class Component { /*class*/ Data *d; /*class*/ Draw *a; }; ------------- from "Component" derive classes like "TextBox", "Button", "Label", "ComboBox" etc from...
1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
9
by: Jack | last post by:
Hello I have a library of calculationally intensive classes that is used both by a GUI based authoring application and by a simpler non-interactive rendering application. Both of these...
9
by: Aguilar, James | last post by:
I know that one can define an essentially unlimited number of classes in a file. And one can declare just as many in a header file. However, the question I have is, should I? Suppose that, to...
12
by: Langy | last post by:
Hello I'm fairly new to C++ but have programmed several other languages and found most of c++ fairly easy (so far!). I've come to a tutorial on classes, could someone please tell me why you...
4
by: john townsley | last post by:
do people prefer to design classes for the particular job or for a rangle of tasks they might encounter now and in the future. i am doing some simple win32 apps and picking classes is simple, but...
2
by: Indiana Epilepsy and Child Neurology | last post by:
Before asking this questions I've spent literally _years_ reading (Meyer, Stroustrup, Holub), googling, asking more general design questions, and just plain thinking about it. I am truly unable to...
0
by: François Pinard | last post by:
Hi, everybody. I wish someone could advise me. I'm running in circles, trying to find an elegant way to devise run-time pluggable classes. It all goes around method resolution order, I guess....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...

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.