indefinite number of arguments

J

Jakob Bieling

I quickly searched the group.

Like the post said, it is not possible to specify indefinite number of
arguments.

http://groups.google.com/group/comp...81798?q=indefinite+number+of+arguments&rnum=1

But I'm wonder with the help of boost, can this take be done?

With or without boost, you can only mimick ab indefinite number of
arguments. The simplest solution is passing a 'vector' of values. This
can be extended to support more than just one type and also to look more
like a function call. But then you are still really passing a fixed
number of arguments (one 'vector' for example).

So strictly speaking, if you have a true indefinite number of
arguments, you cannot possibly determine how many you really have,
without specifying that.

hth
 
P

Phlip

Jakob said:
With or without boost, you can only mimick ab indefinite number of
arguments.

Could you overload operator, and then...

foo(a1, a2, a3, ... aN);

? (the ellipses are narrative)
 
J

Jakob Bieling

Phlip said:
Could you overload operator, and then...

foo(a1, a2, a3, ... aN);

? (the ellipses are narrative)

No, but you could do "foo ((a1, a2, a3, ... aN));".

regards
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top