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();
} 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"
"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.
"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"
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?
It did cancel on my newsgroup server. Just curious, do French speaking
newsgroups have grammatical standards?
no idea.
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" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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={}):...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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,...
|
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,...
| |