
Noah Stein <noah <at> acm.org> writes:
On Behalf Of Thorsten Ottosen
| What about the situation where you need to specify the parameters at | construction, e.g. the RAII paradigm?
I don't think I understand what you're saying.
I agree that your point is well made in the example given. But that's only one example. There are many others. My resulting question is: what's your solution when the parameter list can't be reduced? Frequently, I like to avoid two-step construction and initialization. I don't want every member function to check to see if the object is truly available or uninitialized.
Well, you could construct a valid object with suitable default values. Such an object is valid by definition.
There are times that I can't avoid long parameter lists in my constructors, especially when dealing with classes that sit just on top of hardware. The named parameters library looks like it could facilitate construction by enhancing readability and default value handling.
Did this library support constructors anyway? Given the answer to that question is yes, I'm not sure why you can't do step-wise constrction. -Thorsten