Boost logo

Boost Users :

From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2005-04-28 12:19:09


> Today's Topics:
>
> 1. Re: pimpl and boost (Gennadiy Rozental)
> 2. Re: Re: Re: pimpl and boost (David Gruener)
> 3. Re: Re: Re: pimpl and boost (Jeff Flinn)
>
> ----------------------------------------------------------------------
>

I so wish that pimpl was somehow part of the language. ie you don't
worry about or see the pointer at all, nor do you have to forward all
the function calls. I don't see why the compiler couldn't implement
pimpl for me. (Of course, for cases where you want multiple
implementations at run time, etc, you still do that yourself, but the
typical case the compiler could do).

Maybe:

// h file
class Foo interface
{
  void GetX();
};

// cpp file:
class Foo continue // some keyword
{
   int x;
};

Foo::GetX()
{
   return x;
}

And just like implementing the same function twice, the linker could
warn about 2 implementations of the same class.

P.S. this could also allow you to keep some members defined in the h
file, (and others in the cpp impl) if you wanted the speed of inlines
for some variables, or public/protected variables, etc.

Just a thought. Maybe I should complain elsewhere...


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