indefinite number of arguments

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

  1. Guest

    , Mar 27, 2006
    #1
    1. Advertisements

  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. Advertisements

  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. Advertisements

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:
    833
    Patrice
    Dec 9, 2005
  2. Jenny
    Replies:
    5
    Views:
    970
    Nigel Wade
    Sep 16, 2004
  3. Edward Diener
    Replies:
    14
    Views:
    6,033
    Josiah Carlson
    Apr 6, 2004
  4. Neo
    Replies:
    10
    Views:
    965
    sushant
    Jan 20, 2005
  5. Replies:
    6
    Views:
    449
    Diego Martins
    Mar 30, 2006
  6. tutmann
    Replies:
    4
    Views:
    683
  7. Replies:
    3
    Views:
    1,106
  8. oldyork90
    Replies:
    10
    Views:
    628
    Jorge
    Sep 27, 2008
Loading...