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

Calcule l element maximum d'un tableau

J'ai eu recemmet à implémenter des fonctions
du type is_pointer<> is_polymorphic<> if_then_else<>
qui donnent leur résultat à la compilation.
Un peu comme dans la bibliotheque mpl de boost.

On m'a demander s'il était possible de calculer l'element max
d'un tableau en déduisant ce nombre au moment de la
compilation.

J'ai cherché mais j'ai toujours pas trouver la bonne techique.

static const int tableau [] = {1,2,5,4};
meta::elment_max< Array<tableau,4> >::value // constante devant valoir 5

Es-ce possible?
Si oui avez-vous des idees sur la façon de faire.

Merci.

--
Vianney LANÇON
radix omnia malorum prematurae optimisatia est
-- Donald Knuth
Jul 19 '05 #1
1 3666
Vianney Lançon wrote:
J'ai eu recemmet à implémenter des fonctions
du type is_pointer<> is_polymorphic<> if_then_else<>
qui donnent leur résultat à la compilation.
Un peu comme dans la bibliotheque mpl de boost.

On m'a demander s'il était possible de calculer l'element max
d'un tableau en déduisant ce nombre au moment de la
compilation.

J'ai cherché mais j'ai toujours pas trouver la bonne techique.

static const int tableau [] = {1,2,5,4};
meta::elment_max< Array<tableau,4> >::value // constante devant valoir 5

Es-ce possible?
Si oui avez-vous des idees sur la façon de faire.

Merci.


news:fr.comp.lang.c++ SVP! ;-)

(Ici, nous parlons anglais!)

--ag

--
Artie Gold -- Austin, Texas

Jul 19 '05 #2

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

Similar topics

2
by: Otto Haldi | last post by:
J'ai un formulaire d'on la sélection est généré par une requète MySQL. Je désire maintenant que l'action se déroule immédiatement après avoir sélectionné un choix sans avoir à cliquer sur le...
0
by: mandr | last post by:
Bonjour , j'ai un petit pb sur mon script suivant : <?php // Ouverture de la session session_start();
1
by: Agathe | last post by:
Bonjour, Je souhaite insérer dans une table MySQL des données provenant d'un fichier texte grâce à un script PHP. Mon fichier porte l'extension "txt" et les données sont séparées par des ";'. ...
0
by: grenzo | last post by:
I have seen a software in php that created a graphic mask ( tableau for hotel ). Could anybody tell me like is it possible? Where do I find any example? tanks...
1
by: Wolfgang Lipp | last post by:
my question is: do we need container elements for repeating elements in data-centric xml documents? or is it for some reason very advisable to introduce containers in xml documents even where not...
0
by: Wolfgang Lipp | last post by:
From: Lipp, Wolfgang Sent: Tuesday, 27?January?2004 13:26 <annotation> the first eleven contributions in this thread started as an off-list email discussion; i have posted them here with...
1
by: eXistenZ| | last post by:
Bonjour, je suis entrain de recupérer des données a partir d'une table; et je mets ces données là d'un un tableau, puis j'essaie de mettre le contenu de ce tableau ds une table; le pb c'est...
1
by: Mark Spencer | last post by:
Hey there, I'm running into an issue and wondered if any of you XML gurus know a solution. I'm currently using XML as a data transport mechanism between two applications and an XML schema for...
5
by: Erwin Moller | last post by:
Hi group, Can I retrieve the used width of a span element via javascript? If so how? (I am fine with javascript, but my CSS knowledge leaves a lot to be desired.) I tried using width, but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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...

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.