Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPL] what is my base class?
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2010-05-25 04:42:43


2010/5/22 Nat Goodspeed <nat_at_[hidden]>

> Especially when my base class is a template with a number of parameters, I
> often do write something like:
>
> class Subclass: BaseClass<etc.>
> {
> typedef BaseClass<etc.> super;
> public:
> Subclass(whatever):
> super(whatever),
> ...
> {}
> ...
> };

If your compiler implements injected names correctly (gcc does not), you can
use BaseClass instead of super.

namespace some_long_namespace {
  template <class T>
  struct Base {};
}
struct Derived : some_long_namespace::Base<int> {
  Derived() : Base() {}
};

Roman Perepelitsa.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net