variadic functions

Discussion in 'C++' started by Loony, Sep 12, 2003.

  1. Loony

    Loony Guest

    Hi,

    I want to use variadic functions with stl containers as arguments but
    I am not sure if that is possible and if so how.

    I'm using gcc 3.3 on Suse 8.2

    Hope someone can help me.

    Thanx in advance
     
    Loony, Sep 12, 2003
    #1
    1. Advertising

  2. Loony

    Ron Natalie Guest

    "Loony" <> wrote in message news:...

    > I want to use variadic functions with stl containers as arguments but
    > I am not sure if that is possible and if so how.
    >

    You can not. "If the argumenta has a non-POD class type, the behavior is
    undefined." 5.2.2/7.

    You can pass pointers to these types however.
     
    Ron Natalie, Sep 12, 2003
    #2
    1. Advertising

  3. Loony wrote:

    > Hi,
    >
    > I want to use variadic functions with stl containers as arguments but
    > I am not sure if that is possible and if so how.
    >
    > I'm using gcc 3.3 on Suse 8.2
    >
    > Hope someone can help me.
    >
    > Thanx in advance


    Use variadic functions only as a last resort. Please endeavor to find
    alternatives first. Variadic functions are horribly error-prone.

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
     
    Kevin Goodsell, Sep 12, 2003
    #3
    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. Loony
    Replies:
    3
    Views:
    536
    Ron Natalie
    Sep 19, 2003
  2. Colin Walters
    Replies:
    2
    Views:
    535
    Ben Pfaff
    Feb 13, 2004
  3. Ross A. Finlayson
    Replies:
    19
    Views:
    624
    Keith Thompson
    Mar 10, 2005
  4. Replies:
    2
    Views:
    361
    Dave Thompson
    Feb 27, 2006
  5. Replies:
    5
    Views:
    375
Loading...

Share This Page