Quick Q: Inserting a variadic argument list into a vector?—StackOverflow

Save to:
Instapaper Pocket Readability

From StackOverflow [c++11]:

I have an object that needs to take a variadic argument list in its constructor and store the arguments in a vector. How do I initialize a vector from a the arguments of a variadic constructor?

class GenericNode {
public:
    GenericNode(GenericNode*... inputs) {
            /* Something like... */
        // inputs_.push_back(inputs)...;
}
private:
    std::vector<GenericNode*> inputs_;
};

Continue reading...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.