Variadic Argument in a Constructor

This is a discussion on Variadic Argument in a Constructor within the C++ Programming forums, part of the General Programming Boards category; Hi, I just wanted to ask a simple question. Can I make a constructor that accepts variadic arguments?...

  1. #1
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476

    Variadic Argument in a Constructor

    Hi, I just wanted to ask a simple question. Can I make a constructor that accepts variadic arguments?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,328
    Yes. Be careful, though. There is often a better way to do things than to use variadic arguments.

  3. #3
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    Quote Originally Posted by Daved
    Yes. Be careful, though. There is often a better way to do things than to use variadic arguments.
    Ah thanks. I know that using variadic arguments is not a good way to code. But I need it right now unfortunately.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. default constructor == constructor without argument?
    By cyberfish in forum C++ Programming
    Replies: 6
    Last Post: 04-15-2009, 03:25 AM
  2. Passing A Function Into A Constructor
    By fourplay in forum C++ Programming
    Replies: 6
    Last Post: 03-15-2009, 06:06 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Assignment operator in a constructor argument
    By chadwickstein in forum C++ Programming
    Replies: 4
    Last Post: 09-30-2006, 04:08 PM
  5. calling default instead of argument constructor, why?!
    By cppn00b in forum C++ Programming
    Replies: 6
    Last Post: 01-30-2005, 03:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21