indefinite number of arguments

Discussion in 'C++' started by PengYu.UT@gmail.com, Mar 27, 2006.

  1. Guest

    , Mar 27, 2006
    #1
    1. Advertising

  2. wrote:
    > 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
    --
    jb

    (reply address in rot13, unscramble first)
    Jakob Bieling, Mar 27, 2006
    #2
    1. Advertising

  3. Phlip Guest

    Jakob Bieling wrote:

    > 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)

    --
    Phlip
    http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
    Phlip, Mar 27, 2006
    #3
  4. Phlip <> wrote:
    > Jakob Bieling wrote:
    >
    >> 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)


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

    regards
    --
    jb

    (reply address in rot13, unscramble first)
    Jakob Bieling, Mar 27, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?T2xlZw==?=

    Session timeout indefinite

    =?Utf-8?B?T2xlZw==?=, Dec 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    742
    Patrice
    Dec 9, 2005
  2. Jenny
    Replies:
    5
    Views:
    815
    Nigel Wade
    Sep 16, 2004
  3. Dave Thompson

    Re: Structures of indefinite size

    Dave Thompson, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    758
    Dave Thompson
    Jun 26, 2003
  4. Replies:
    6
    Views:
    324
    Diego Martins
    Mar 30, 2006
  5. Replies:
    3
    Views:
    812
Loading...

Share This Page