Quick A: With a lambda function. Try
const mytype myobj{ []{ /* compute value */ return value; } }.
How would you initialize a const vector of function results using C++11?
Is it possible to use something like
generate_nto create aconst vectorof, say, random numbers? I couldn't think of a way to do it without derivingvectorand doing the assignment in the constructor.

Add a Comment
Comments are closed.