
christopher diggins <cdiggins <at> videotron.ca> writes:
----- Original Message ----- From: "Jonathan Turkanis" <technews <at> kangaroologic.com>
I don't see why this is better than
struct toupper_filter : input_filter { template<typename Source> int get(Source& src) { return toupper(boost::io::get(src)); } };
and its cousins.
Then that pretty much closes the discussion. If you do not see the benefits of the lower complexity, then there really is little more I can do to convince you otherwise.
The first thing that's apparent to me is that the actual difference in complexity between the ToUpper you wrote and the toupper_filter quoted here is really quite minor. The second thing that's apparent is that your ToUpper relies on global variables, whereas toupper_filter relies on function arguments, which in my mind is a more heavily-weighted concern than the complexity difference. My question is why you do you think relying on globals is a better approach? Some of your points have been motivated by the needs of novice C++ programmers; do you really think it is better to advocate a programming style that relies on global variables? Bob