|
Boost : |
From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-09-10 15:30:09
"George M. Garner Jr." <gmgarner_at_[hidden]> wrote in message
news:cht154$fsl$1_at_sea.gmane.org...
> Jonathan,
>
> > The problem is here ^^^^^^^ <
>
> Chain.hpp includes code at line 292 that derives the character type from, in
> effect, the most derived class:
Right, that's what it's supposed to do.
> This yields correct results provided you are consistent in doing this. You
> might want to include something like this in your samples since an ounce of
> prevention is worth a pound of cure:
>
> STATIC_CHECK(sizeof(char_type) == sizeof(typename output_filter::char_type),
> Error_char_type_mismatch_with_base_class)
Could you be more specific? There are many places in the source where I use
static asserts to make sure character types match. The problem with your
previous example is that you were misusing the base class (I don't blame you --
I blame the docs)
It's as if you were to write:
struct printer : std::unary_function<int, void> {
typedef int result_type;
int operator() (int n) const { std::cout << n; }
};
This is an incorrect use of std::unary_function.
> Also, one good Unicode sample will accomplish more than many pages of
> documentation. The samples should show how to accomplish common programming
> tasks.
Quite right.
>
> Regards,
>
> George.
>
Jonathan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk