Boost logo

Boost :

From: Peter Bindels (dascandy_at_[hidden])
Date: 2007-06-23 04:55:04


On 22/06/07, Seweryn Habdank-Wojewódzki <shw_at_[hidden]> wrote:
> So I am looking for the example where e.g. topological sorting of symbols can
> destroy functionality. The example above is no that case.
>
> But this code is an example of the bad design. So am looking the code where
> design is good, and any sorting of symbols will change functionality.

What about using a template class with a partial specialization that
is defined afterwards?

template <class A>
class T {
 A a;
};

int func() {
    return sizeof(T<void *>);
}

template <class A>
class T<A *> {
  A *a[10];
};

I think that all uses that change the meaning of any symbol after it's
defined is bad design or bad implementation. If you were to change the
ordering inherently, you'd have to give very explicit warnings or
errors on these kinds of situations (in particular, typedefs and
partial specializations).

Regards,
Peter


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk